Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102758186
D45451.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
971 B
Referenced Files
None
Subscribers
None
D45451.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
@@ -5,6 +5,7 @@
* Copyright (c) 2010 Panasas, Inc.
* 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
@@ -41,6 +42,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 clamp(x, lo, hi) min(max(x, lo), hi)
#define min_t(type, x, y) ({ \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 6:27 PM (22 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14683141
Default Alt Text
D45451.diff (971 B)
Attached To
Mode
D45451: LinuxKPI: Add min_not_zero() to linux/minmax.h
Attached
Detach File
Event Timeline
Log In to Comment