[PATCH next] linux/bits.h: Simplify GENMASK()

David Laight posted 1 patch 1 year ago
There is a newer version of this series
include/linux/bits.h      | 43 ++++++++++++++++-----------------------
include/uapi/linux/bits.h | 15 +++++++-------
2 files changed, 24 insertions(+), 34 deletions(-)
[PATCH next] linux/bits.h: Simplify GENMASK()
Posted by David Laight 1 year ago
Change 95b980d62d52c replaced ~0ul and ~0ull with ~UL(0) and ~ULL(0)
in the GENMASK() defines as part of a change to allow the bitops
definitions be used from assembly.

The definitions have since been moved to a uapi header which
probably shouldn't require some other header be included first.

The definition of __GENMASK() is also overcomplicated partially
due to avoiding overflow warnings from shifting ~0u left.

Implement GENMASK() using the simpler (1u << hi) * 2 - (1u << lo) formula.
This doesn't rely on right shifts and doesn't need to know the number
of bits in the integral type.
It can be used for different types by just changing the type of the 1u.
__GENMASK() __GENMASK_ULL() and __GENMASK_U128() can now implemeted
using a single ___GENMASK(one, hi, lo).

Overflow warnings (from shifting out the MSB) are avoided by subtracting 1
before the multiply and adding two back in later.
The complers see straight through the subterfuge when generating code.

Since there are already conditionals for ASSEMBLY in bits.h, for ASSEMBLY
directly expand GENMASK() and GENMASK_ULL() as ___GENMASK(1, hi, lo)
rather than through the __GENMASK() and __GENMASK_ULL() uapi defines.
Remove the UL(x) and ULL(x) from the uapi file.

GENMASK() and GENMASK_ULL() now generate the correct values when
ASSEMBLY is defined.
Fortunately they've never been used.

Rename 'h' to 'hi' and 'l' to 'lo' because 'l' looks like '1' in many fonts.

Signed-off-by: David Laight <david.laight@aculab.com>
---
 include/linux/bits.h      | 43 ++++++++++++++++-----------------------
 include/uapi/linux/bits.h | 15 +++++++-------
 2 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/include/linux/bits.h b/include/linux/bits.h
index 60044b608817..d5cf0ec22e43 100644
--- a/include/linux/bits.h
+++ b/include/linux/bits.h
@@ -14,41 +14,32 @@
 #define BITS_PER_BYTE		8
 
 /*
- * Create a contiguous bitmask starting at bit position @l and ending at
- * position @h. For example
+ * Create a contiguous bitmask starting at bit position @lo and ending at
+ * position @hi. For example
  * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
  */
 #if !defined(__ASSEMBLY__)
 #include <linux/build_bug.h>
-#define GENMASK_INPUT_CHECK(h, l) \
+#define GENMASK_INPUT_CHECK(hi, lo) \
 	(BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
-		__is_constexpr((l) > (h)), (l) > (h), 0)))
-#else
-/*
- * BUILD_BUG_ON_ZERO is not available in h files included from asm files,
- * disable the input check if that is the case.
- */
-#define GENMASK_INPUT_CHECK(h, l) 0
-#endif
+		__is_constexpr((lo) > (hi)), (lo) > (hi), 0)))
 
-#define GENMASK(h, l) \
-	(GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
-#define GENMASK_ULL(h, l) \
-	(GENMASK_INPUT_CHECK(h, l) + __GENMASK_ULL(h, l))
+#define GENMASK(hi, lo) \
+	(GENMASK_INPUT_CHECK(hi, lo) + __GENMASK(hi, lo))
+#define GENMASK_ULL(hi, lo) \
+	(GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_ULL(hi, lo))
 
-#if !defined(__ASSEMBLY__)
+#define GENMASK_U128(hi, lo) \
+	(GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
+#else
 /*
- * Missing asm support
- *
- * __GENMASK_U128() depends on _BIT128() which would not work
- * in the asm code, as it shifts an 'unsigned __init128' data
- * type instead of direct representation of 128 bit constants
- * such as long and unsigned long. The fundamental problem is
- * that a 128 bit constant will get silently truncated by the
- * gcc compiler.
+ * BUILD_BUG_ON_ZERO is not available in h files included from asm files,
+ * 128bit exprssions don't work, neither can C 0UL (etc) constants be used.
+ * These definitions only have to work for constants and don't require
+ * that ~0 have any specific number of set bits.
  */
-#define GENMASK_U128(h, l) \
-	(GENMASK_INPUT_CHECK(h, l) + __GENMASK_U128(h, l))
+#define GENMASK(hi, lo) ___GENMASK(1, hi, lo)
+#define GENMASK_ULL(hi, lo) ___GENMASK(1, hi, lo)
 #endif
 
 #endif	/* __LINUX_BITS_H */
diff --git a/include/uapi/linux/bits.h b/include/uapi/linux/bits.h
index 5ee30f882736..a25d9dfb7072 100644
--- a/include/uapi/linux/bits.h
+++ b/include/uapi/linux/bits.h
@@ -4,15 +4,14 @@
 #ifndef _UAPI_LINUX_BITS_H
 #define _UAPI_LINUX_BITS_H
 
-#define __GENMASK(h, l) \
-        (((~_UL(0)) - (_UL(1) << (l)) + 1) & \
-         (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
+/* Result is '(1u << (hi + 1)) - (1u << lo)' coded to avoid overflow. */
+#define ___GENMASK(one, hi, lo) \
+	((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
 
-#define __GENMASK_ULL(h, l) \
-        (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \
-         (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
+#define __GENMASK(hi, lo) ___GENMASK(1UL, hi, lo)
 
-#define __GENMASK_U128(h, l) \
-	((_BIT128((h)) << 1) - (_BIT128(l)))
+#define __GENMASK_ULL(hi, lo) ___GENMASK(1ULL, hi, lo)
+
+#define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
 
 #endif /* _UAPI_LINUX_BITS_H */
-- 
2.17.1

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Re: [PATCH next] linux/bits.h: Simplify GENMASK()
Posted by kernel test robot 1 year ago
Hi David,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v6.13-rc3]
[cannot apply to next-20241213 next-20241213]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Laight/linux-bits-h-Simplify-GENMASK/20241216-040445
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/8423d75207f64e4081f0019601b4a016%40AcuMS.aculab.com
patch subject: [PATCH next] linux/bits.h: Simplify GENMASK()
config: loongarch-randconfig-001-20241216 (https://download.01.org/0day-ci/archive/20241216/202412161103.LytYDSSl-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241216/202412161103.LytYDSSl-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412161103.LytYDSSl-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from lib/test_bits.c:6:
   lib/test_bits.c: In function 'genmask_u128_test':
>> include/uapi/linux/bits.h:15:44: error: '__uint128' undeclared (first use in this function); did you mean '__int128'?
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                            ^~~~~~~~~
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:46:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:46:54: note: in expansion of macro 'GENMASK_U128'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:15:44: note: each undeclared identifier is reported only once for each function it appears in
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                            ^~~~~~~~~
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:46:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:46:54: note: in expansion of macro 'GENMASK_U128'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:46:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:46:54: note: in expansion of macro 'GENMASK_U128'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:12: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |            ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:46:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:46:54: note: in expansion of macro 'GENMASK_U128'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:46:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:46:54: note: in expansion of macro 'GENMASK_U128'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:44: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |                                            ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:46:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:46:54: note: in expansion of macro 'GENMASK_U128'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:46:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:46:54: note: in expansion of macro 'GENMASK_U128'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:12: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |            ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:46:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:46:54: note: in expansion of macro 'GENMASK_U128'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:46:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:46:54: note: in expansion of macro 'GENMASK_U128'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:44: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |                                            ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:46:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:46:54: note: in expansion of macro 'GENMASK_U128'
      46 |         KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:47:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:47:54: note: in expansion of macro 'GENMASK_U128'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:12: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |            ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:47:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:47:54: note: in expansion of macro 'GENMASK_U128'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:47:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:47:54: note: in expansion of macro 'GENMASK_U128'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:44: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |                                            ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:47:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:47:54: note: in expansion of macro 'GENMASK_U128'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:47:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:47:54: note: in expansion of macro 'GENMASK_U128'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:12: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |            ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:47:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:47:54: note: in expansion of macro 'GENMASK_U128'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:47:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:47:54: note: in expansion of macro 'GENMASK_U128'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:44: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |                                            ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:47:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:47:54: note: in expansion of macro 'GENMASK_U128'
      47 |         KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:48:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:48:54: note: in expansion of macro 'GENMASK_U128'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:12: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |            ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:48:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:48:54: note: in expansion of macro 'GENMASK_U128'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:48:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:48:54: note: in expansion of macro 'GENMASK_U128'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:44: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |                                            ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:48:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:48:54: note: in expansion of macro 'GENMASK_U128'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:48:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:48:54: note: in expansion of macro 'GENMASK_U128'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:12: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |            ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:48:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:48:54: note: in expansion of macro 'GENMASK_U128'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:48:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:48:54: note: in expansion of macro 'GENMASK_U128'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:44: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |                                            ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:48:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:48:54: note: in expansion of macro 'GENMASK_U128'
      48 |         KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:49:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:49:54: note: in expansion of macro 'GENMASK_U128'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:12: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |            ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:49:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:49:54: note: in expansion of macro 'GENMASK_U128'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:49:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:49:54: note: in expansion of macro 'GENMASK_U128'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:44: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |                                            ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:49:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:49:54: note: in expansion of macro 'GENMASK_U128'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:49:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:49:54: note: in expansion of macro 'GENMASK_U128'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:12: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |            ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:49:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:49:54: note: in expansion of macro 'GENMASK_U128'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:49:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:49:54: note: in expansion of macro 'GENMASK_U128'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:44: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |                                            ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:49:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:49:54: note: in expansion of macro 'GENMASK_U128'
      49 |         KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:50:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:50:54: note: in expansion of macro 'GENMASK_U128'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:12: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |            ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:50:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:50:54: note: in expansion of macro 'GENMASK_U128'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:50:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:50:54: note: in expansion of macro 'GENMASK_U128'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:44: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |                                            ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                      ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:50:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:50:54: note: in expansion of macro 'GENMASK_U128'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |                                                      ^~~~~~~~~~~~
>> include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:50:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:50:54: note: in expansion of macro 'GENMASK_U128'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:12: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |            ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:50:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:50:54: note: in expansion of macro 'GENMASK_U128'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:50:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:50:54: note: in expansion of macro 'GENMASK_U128'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:9:44: note: to match this '('
       9 |         ((((one) << (hi)) - 1) * 2 + 1 - (((one) << (lo)) - 1))
         |                                            ^
   include/kunit/test.h:774:40: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \
         |                                        ^~~~~
   include/kunit/test.h:969:9: note: in expansion of macro 'KUNIT_BINARY_INT_ASSERTION'
     969 |         KUNIT_BINARY_INT_ASSERTION(test,                                       \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/kunit/test.h:966:9: note: in expansion of macro 'KUNIT_EXPECT_EQ_MSG'
     966 |         KUNIT_EXPECT_EQ_MSG(test, left, right, NULL)
         |         ^~~~~~~~~~~~~~~~~~~
   lib/test_bits.c:50:9: note: in expansion of macro 'KUNIT_EXPECT_EQ'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |         ^~~~~~~~~~~~~~~
   include/uapi/linux/bits.h:15:32: note: in expansion of macro '___GENMASK'
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                ^~~~~~~~~~
   include/linux/bits.h:33:40: note: in expansion of macro '__GENMASK_U128'
      33 |         (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
         |                                        ^~~~~~~~~~~~~~
   lib/test_bits.c:50:54: note: in expansion of macro 'GENMASK_U128'
      50 |         KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
         |                                                      ^~~~~~~~~~~~
   include/uapi/linux/bits.h:15:54: error: expected ')' before numeric constant
      15 | #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
         |                                                      ^
   include/kunit/test.h:774:22: note: in definition of macro 'KUNIT_BASE_BINARY_ASSERTION'
     774 |         const typeof(right) __right = (right);                                 \


vim +15 include/uapi/linux/bits.h

    14	
  > 15	#define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
    16	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH next] linux/bits.h: Simplify GENMASK()
Posted by kernel test robot 1 year ago
Hi David,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v6.13-rc2]
[cannot apply to next-20241213 next-20241213]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Laight/linux-bits-h-Simplify-GENMASK/20241216-040445
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/8423d75207f64e4081f0019601b4a016%40AcuMS.aculab.com
patch subject: [PATCH next] linux/bits.h: Simplify GENMASK()
config: arm64-randconfig-004-20241216 (https://download.01.org/0day-ci/archive/20241216/202412160756.7tFtCu4g-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241216/202412160756.7tFtCu4g-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412160756.7tFtCu4g-lkp@intel.com/

All errors (new ones prefixed by >>):

>> lib/test_bits.c:46:47: error: use of undeclared identifier '__uint128'
           KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
                                                        ^
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
>> lib/test_bits.c:46:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
>> lib/test_bits.c:46:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
>> lib/test_bits.c:46:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:47:47: error: use of undeclared identifier '__uint128'
           KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
                                                        ^
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:47:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:47:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:47:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:48:47: error: use of undeclared identifier '__uint128'
           KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
                                                        ^
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:48:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:48:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:48:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:49:47: error: use of undeclared identifier '__uint128'
           KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
                                                        ^
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:49:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:49:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:49:47: error: use of undeclared identifier '__uint128'
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'
           (GENMASK_INPUT_CHECK(hi, lo) + __GENMASK_U128(hi, lo))
                                          ^
   include/uapi/linux/bits.h:15:44: note: expanded from macro '__GENMASK_U128'
   #define __GENMASK_U128(hi, lo) ___GENMASK((__uint128)1, hi, lo)
                                              ^
   lib/test_bits.c:50:47: error: use of undeclared identifier '__uint128'
           KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
                                                        ^
   include/linux/bits.h:33:33: note: expanded from macro 'GENMASK_U128'


vim +/__uint128 +46 lib/test_bits.c

6d511020e13d5d6 Rikard Falkeborn  2020-08-11  41  
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  42  static void genmask_u128_test(struct kunit *test)
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  43  {
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  44  #ifdef CONFIG_ARCH_SUPPORTS_INT128
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  45  	/* Below 64 bit masks */
d7bcc37436c7d37 Anshuman Khandual 2024-08-22 @46  	KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(0, 0));
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  47  	KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(1, 0));
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  48  	KUNIT_EXPECT_EQ(test, 0x0000000000000006ull, GENMASK_U128(2, 1));
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  49  	KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(31, 0));
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  50  	KUNIT_EXPECT_EQ(test, 0x000000ffffe00000ull, GENMASK_U128(39, 21));
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  51  	KUNIT_EXPECT_EQ(test, 0xffffffffffffffffull, GENMASK_U128(63, 0));
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  52  
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  53  	/* Above 64 bit masks - only 64 bit portion can be validated once */
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  54  	KUNIT_EXPECT_EQ(test, 0xffffffffffffffffull, GENMASK_U128(64, 0) >> 1);
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  55  	KUNIT_EXPECT_EQ(test, 0x00000000ffffffffull, GENMASK_U128(81, 50) >> 50);
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  56  	KUNIT_EXPECT_EQ(test, 0x0000000000ffffffull, GENMASK_U128(87, 64) >> 64);
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  57  	KUNIT_EXPECT_EQ(test, 0x0000000000ff0000ull, GENMASK_U128(87, 80) >> 64);
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  58  
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  59  	KUNIT_EXPECT_EQ(test, 0xffffffffffffffffull, GENMASK_U128(127, 0) >> 64);
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  60  	KUNIT_EXPECT_EQ(test, 0xffffffffffffffffull, (u64)GENMASK_U128(127, 0));
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  61  	KUNIT_EXPECT_EQ(test, 0x0000000000000003ull, GENMASK_U128(127, 126) >> 126);
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  62  	KUNIT_EXPECT_EQ(test, 0x0000000000000001ull, GENMASK_U128(127, 127) >> 127);
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  63  #ifdef TEST_GENMASK_FAILURES
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  64  	/* these should fail compilation */
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  65  	GENMASK_U128(0, 1);
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  66  	GENMASK_U128(0, 10);
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  67  	GENMASK_U128(9, 10);
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  68  #endif /* TEST_GENMASK_FAILURES */
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  69  #endif /* CONFIG_ARCH_SUPPORTS_INT128 */
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  70  }
d7bcc37436c7d37 Anshuman Khandual 2024-08-22  71  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki