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@xxxxxxxxx/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@xxxxxxxxx/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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202412160756.7tFtCu4g-lkp@xxxxxxxxx/ 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