diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-12-07 09:48:06 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-12-28 13:19:47 +0000 |
commit | 20a930e44db4f6e89c6ee950081b8d1d0f39998a (patch) | |
tree | 23f34487ab0a32dda68ee7308c57c56e5669881e | |
parent | 8bebb7024d64859082e0bfbc9be6e42672543d16 (diff) | |
download | src-20a930e44db4f6e89c6ee950081b8d1d0f39998a.tar.gz src-20a930e44db4f6e89c6ee950081b8d1d0f39998a.zip |
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
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/bitops.h | 2 | ||||
-rw-r--r-- | 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; |