tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: cc726712137756f27af36c01e3fd7f9f260f639c commit: 4213ff7957de370c1cfe528c2bad1eb2e499038a [7604/7624] net/ethernet/huawei/hinic3: Add the CQM on which the RDMA depends config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240429/202404291452.urCRP2Hn-lkp@i...) compiler: clang version 18.1.4 (https://github.com/llvm/llvm-project e6c3289804a67ea0bb6a86fadbe454dd93b8d855) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240429/202404291452.urCRP2Hn-lkp@i...)
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/202404291452.urCRP2Hn-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/net/ethernet/huawei/hinic3/cqm/cqm_bitmap_table.c:371:3: error: a randomized struct can only be initialized with a designated initializer
371 | {check_for_use_node_alloc, cqm_buf_use_node_alloc_page}, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_bitmap_table.c:372:3: error: a randomized struct can only be initialized with a designated initializer 372 | {check_for_nouse_node_alloc, cqm_buf_unused_node_alloc_page} | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_bitmap_table.c:376:3: error: a randomized struct can only be initialized with a designated initializer 376 | {check_use_non_vram, cqm_buf_free_page_common} | ^
drivers/net/ethernet/huawei/hinic3/cqm/cqm_bitmap_table.c:382:25: error: invalid application of 'sizeof' to an incomplete type 'const struct malloc_memory[]'
382 | u32 malloc_funcs_num = ARRAY_SIZE(g_malloc_funcs); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kernel.h:57:32: note: expanded from macro 'ARRAY_SIZE' 57 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) | ^~~~~
drivers/net/ethernet/huawei/hinic3/cqm/cqm_bitmap_table.c:399:23: error: invalid application of 'sizeof' to an incomplete type 'const struct free_memory[]'
399 | u32 free_funcs_num = ARRAY_SIZE(g_free_funcs); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kernel.h:57:32: note: expanded from macro 'ARRAY_SIZE' 57 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) | ^~~~~ 5 errors generated.
vim +371 drivers/net/ethernet/huawei/hinic3/cqm/cqm_bitmap_table.c
369 370 static const struct malloc_memory g_malloc_funcs[] = {
371 {check_for_use_node_alloc, cqm_buf_use_node_alloc_page},
372 {check_for_nouse_node_alloc, cqm_buf_unused_node_alloc_page} 373 }; 374 375 static const struct free_memory g_free_funcs[] = { 376 {check_use_non_vram, cqm_buf_free_page_common} 377 }; 378 379 static s32 cqm_buf_alloc_page(struct tag_cqm_handle *cqm_handle, struct tag_cqm_buf *buf) 380 { 381 struct hinic3_hwdev *handle = cqm_handle->ex_handle;
382 u32 malloc_funcs_num = ARRAY_SIZE(g_malloc_funcs);
383 u32 i; 384 385 for (i = 0; i < malloc_funcs_num; i++) { 386 if (g_malloc_funcs[i].check_alloc_mode && 387 g_malloc_funcs[i].malloc_func && 388 g_malloc_funcs[i].check_alloc_mode(handle, buf)) 389 return g_malloc_funcs[i].malloc_func(handle, buf); 390 } 391 392 cqm_err(handle->dev_hdl, "Unknown alloc mode\n"); 393 394 return CQM_FAIL; 395 } 396 397 static void cqm_buf_free_page(struct tag_cqm_buf *buf) 398 {
399 u32 free_funcs_num = ARRAY_SIZE(g_free_funcs);
400 u32 i; 401 402 for (i = 0; i < free_funcs_num; i++) { 403 if (g_free_funcs[i].check_alloc_mode && 404 g_free_funcs[i].free_func && 405 g_free_funcs[i].check_alloc_mode(NULL, buf)) 406 return g_free_funcs[i].free_func(buf); 407 } 408 } 409