Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161750132
D45450.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D45450.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/minmax.h b/sys/compat/linuxkpi/common/include/linux/minmax.h
--- a/sys/compat/linuxkpi/common/include/linux/minmax.h
+++ b/sys/compat/linuxkpi/common/include/linux/minmax.h
@@ -7,6 +7,7 @@
* Copyright (c) 2014-2015 François Tigeot
* Copyright (c) 2015 Hans Petter Selasky <hselasky@FreeBSD.org>
* Copyright (c) 2016 Matt Macy <mmacy@FreeBSD.org>
+ * Copyright (c) 2023 Serenity Cyber Security, LLC.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -43,6 +44,12 @@
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
+#define min_not_zero(x, y) ({ \
+ __typeof(x) __min1 = (x); \
+ __typeof(y) __min2 = (y); \
+ __min1 == 0 ? __min2 : ((__min2 == 0) ? __min1 : min(__min1, __min2));\
+})
+
#define min_t(type, x, y) ({ \
type __min1 = (x); \
type __min2 = (y); \
diff --git a/sys/dev/bnxt/bnxt_re/bnxt_re.h b/sys/dev/bnxt/bnxt_re/bnxt_re.h
--- a/sys/dev/bnxt/bnxt_re/bnxt_re.h
+++ b/sys/dev/bnxt/bnxt_re/bnxt_re.h
@@ -100,10 +100,12 @@
* @x: value1
* @y: value2
*/
+#ifndef min_not_zero
#define min_not_zero(x, y) ({ \
typeof(x) __x = (x); \
typeof(y) __y = (y); \
__x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); })
+#endif
struct ib_mr_init_attr {
int max_reg_descriptors;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jul 7, 12:46 PM (13 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34798016
Default Alt Text
D45450.diff (1 KB)
Attached To
Mode
D45450: bnxt_re: Define min_not_zero macro only if it is not defined yet.
Attached
Detach File
Event Timeline
Log In to Comment