git: 20a930e44db4 - stable/12 - MFC r368406: Prefer using the MIN() function macro over the min() inline function in the LinuxKPI. Linux defines min() to be a macro, while in FreeBSD min() is a static inline function clamping its arguments to "unsigned int".
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Dec 28 13:20:34 UTC 2020
The branch stable/12 has been updated by hselasky:
URL: https://cgit.FreeBSD.org/src/commit/?id=20a930e44db4f6e89c6ee950081b8d1d0f39998a
commit 20a930e44db4f6e89c6ee950081b8d1d0f39998a
Author: Hans Petter Selasky <hselasky at FreeBSD.org>
AuthorDate: 2020-12-07 09:48:06 +0000
Commit: Hans Petter Selasky <hselasky at FreeBSD.org>
CommitDate: 2020-12-28 13:19:47 +0000
MFC r368406:
Prefer using the MIN() function macro over the min() inline function
in the LinuxKPI. Linux defines min() to be a macro, while in FreeBSD
min() is a static inline function clamping its arguments to
"unsigned int".
Sponsored by: Mellanox Technologies // NVIDIA Networking
---
sys/compat/linuxkpi/common/include/linux/bitops.h | 2 +-
sys/compat/linuxkpi/common/include/linux/scatterlist.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h
index 7e259760f7c3..3bcfd69ba5c5 100644
--- a/sys/compat/linuxkpi/common/include/linux/bitops.h
+++ b/sys/compat/linuxkpi/common/include/linux/bitops.h
@@ -364,7 +364,7 @@ linux_reg_op(unsigned long *bitmap, int pos, int order, int reg_op)
index = pos / BITS_PER_LONG;
offset = pos - (index * BITS_PER_LONG);
nlongs_reg = BITS_TO_LONGS(nbits_reg);
- nbitsinlong = min(nbits_reg, BITS_PER_LONG);
+ nbitsinlong = MIN(nbits_reg, BITS_PER_LONG);
mask = (1UL << (nbitsinlong - 1));
mask += mask - 1;
diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h
index a23edfb0b4de..2d4b05ba5cb1 100644
--- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h
+++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h
@@ -343,7 +343,7 @@ __sg_alloc_table_from_pages(struct sg_table *sgt,
}
seg_size = ((j - cur) << PAGE_SHIFT) - off;
- sg_set_page(s, pages[cur], min(size, seg_size), off);
+ sg_set_page(s, pages[cur], MIN(size, seg_size), off);
size -= seg_size;
off = 0;
cur = j;
More information about the dev-commits-src-all
mailing list