Hi Arunpravin, kernel test robot noticed the following build warnings:
[auto build test WARNING on 9d757669b2b22cd224c334924f798393ffca537c] url: https://github.com/intel-lab-lkp/linux/commits/Arunpravin-Paneer-Selvam/drm-buddy-Add-KUnit-test-for-offset-aligned-allocations/20260209-163512 base: 9d757669b2b22cd224c334924f798393ffca537c patch link: https://lore.kernel.org/r/20260209083051.13376-2-Arunpravin.PaneerSelvam%40amd.com patch subject: [PATCH v3 2/2] drm/buddy: Add KUnit test for offset-aligned allocations config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20260210/[email protected]/config) compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260210/[email protected]/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 <[email protected]> | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ All warnings (new ones prefixed by >>): drivers/gpu/tests/gpu_buddy_test.c:46:7: error: too many arguments provided to function-like macro invocation "buddy_init failed\n"); ^ include/kunit/test.h:1390:9: note: macro 'KUNIT_ASSERT_FALSE' defined here #define KUNIT_ASSERT_FALSE(test, condition) \ ^ drivers/gpu/tests/gpu_buddy_test.c:45:2: error: use of undeclared identifier 'KUNIT_ASSERT_FALSE'; did you mean 'KUNIT_ASSERTION'? KUNIT_ASSERT_FALSE(test, gpu_buddy_init(&mm, mm_size, SZ_4K), ^~~~~~~~~~~~~~~~~~ KUNIT_ASSERTION include/kunit/assert.h:27:2: note: 'KUNIT_ASSERTION' declared here KUNIT_ASSERTION, ^ >> drivers/gpu/tests/gpu_buddy_test.c:45:2: warning: expression result unused >> [-Wunused-value] KUNIT_ASSERT_FALSE(test, gpu_buddy_init(&mm, mm_size, SZ_4K), ^~~~~~~~~~~~~~~~~~ 1 warning and 2 errors generated. vim +45 drivers/gpu/tests/gpu_buddy_test.c 23 24 static void gpu_test_buddy_subtree_offset_alignment_stress(struct kunit *test) 25 { 26 struct gpu_buddy_block *block; 27 struct rb_node *node = NULL; 28 const u64 mm_size = SZ_2M; 29 const u64 alignments[] = { 30 SZ_1M, 31 SZ_512K, 32 SZ_256K, 33 SZ_128K, 34 SZ_64K, 35 SZ_32K, 36 SZ_16K, 37 SZ_8K, 38 }; 39 40 struct list_head allocated[ARRAY_SIZE(alignments)]; 41 unsigned int i, order, max_subtree_align = 0; 42 struct gpu_buddy mm; 43 int ret, tree; 44 > 45 KUNIT_ASSERT_FALSE(test, gpu_buddy_init(&mm, mm_size, SZ_4K), 46 "buddy_init failed\n"); 47 48 for (i = 0; i < ARRAY_SIZE(allocated); i++) 49 INIT_LIST_HEAD(&allocated[i]); 50 51 /* 52 * Exercise subtree_max_alignment tracking by allocating blocks with descending 53 * alignment constraints and freeing them in reverse order. This verifies that 54 * free-tree augmentation correctly propagates the maximum offset alignment 55 * present in each subtree at every stage. 56 */ 57 58 for (i = 0; i < ARRAY_SIZE(alignments); i++) { 59 struct gpu_buddy_block *root = NULL; 60 unsigned int expected; 61 u64 align; 62 63 align = alignments[i]; 64 expected = ilog2(align) - 1; 65 66 for (;;) { 67 ret = gpu_buddy_alloc_blocks(&mm, 68 0, mm_size, 69 SZ_4K, align, 70 &allocated[i], 71 0); 72 if (ret) 73 break; 74 75 block = list_last_entry(&allocated[i], 76 struct gpu_buddy_block, 77 link); 78 KUNIT_EXPECT_EQ(test, gpu_buddy_block_offset(block) & (align - 1), 0ULL); 79 } 80 81 for (order = mm.max_order + 1; order-- > 0 && !root; ) { 82 for (tree = 0; tree < 2; tree++) { 83 node = mm.free_trees[tree][order].rb_node; 84 if (node) { 85 root = container_of(node, 86 struct gpu_buddy_block, 87 rb); 88 break; 89 } 90 } 91 } 92 93 KUNIT_ASSERT_NOT_NULL(test, root); 94 KUNIT_EXPECT_EQ(test, root->subtree_max_alignment, expected); 95 } 96 97 for (i = ARRAY_SIZE(alignments); i-- > 0; ) { 98 gpu_buddy_free_list(&mm, &allocated[i], 0); 99 100 for (order = 0; order <= mm.max_order; order++) { 101 for (tree = 0; tree < 2; tree++) { 102 node = mm.free_trees[tree][order].rb_node; 103 if (!node) 104 continue; 105 106 block = container_of(node, struct gpu_buddy_block, rb); 107 max_subtree_align = max(max_subtree_align, block->subtree_max_alignment); 108 } 109 } 110 111 KUNIT_EXPECT_GE(test, max_subtree_align, ilog2(alignments[i])); 112 } 113 114 gpu_buddy_fini(&mm); 115 } 116 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
