Date: Mon, 7 Dec 2020 09:48:07 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368406 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <202012070948.0B79m7Hx056116@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon Dec 7 09:48:06 2020 New Revision: 368406 URL: https://svnweb.freebsd.org/changeset/base/368406 Log: 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". MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon Dec 7 09:21:06 2020 (r368405) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon Dec 7 09:48:06 2020 (r368406) @@ -360,7 +360,7 @@ linux_reg_op(unsigned long *bitmap, int pos, int order 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; Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon Dec 7 09:21:06 2020 (r368405) +++ head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon Dec 7 09:48:06 2020 (r368406) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012070948.0B79m7Hx056116>