[openeuler:OLK-6.6 3116/3116] drivers/ub/ubase/ubase_cmd.c:551:26: warning: variable 'desc' set but not used
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: b2b8512ca97108929f3aca5405875d91577b8c80 commit: 663203772f391e4bd5f17d800974f694137fc2e9 [3116/3116] !18710 ub: ubase: Add support of base driver for ub network config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20251106/202511061247.ZMPukP6K-lkp@i...) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d2625a438020ad35330cda29c3def102c1687b1b) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251106/202511061247.ZMPukP6K-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/202511061247.ZMPukP6K-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from <built-in>:3: In file included from include/linux/compiler_types.h:150: include/linux/compiler-clang.h:42:9: warning: '__SANITIZE_THREAD__' macro redefined [-Wmacro-redefined] 42 | #define __SANITIZE_THREAD__ | ^ <built-in>:368:9: note: previous definition is here 368 | #define __SANITIZE_THREAD__ 1 | ^
drivers/ub/ubase/ubase_cmd.c:551:26: warning: variable 'desc' set but not used [-Wunused-but-set-variable] 551 | struct ubase_cmdq_desc *desc; | ^ drivers/ub/ubase/ubase_cmd.c:576:6: warning: no previous prototype for function 'ubase_cmd_crq_handler' [-Wmissing-prototypes] 576 | void ubase_cmd_crq_handler(struct ubase_dev *udev) | ^ drivers/ub/ubase/ubase_cmd.c:576:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 576 | void ubase_cmd_crq_handler(struct ubase_dev *udev) | ^ | static 3 warnings generated. -- In file included from <built-in>:3: In file included from include/linux/compiler_types.h:150: include/linux/compiler-clang.h:42:9: warning: '__SANITIZE_THREAD__' macro redefined [-Wmacro-redefined] 42 | #define __SANITIZE_THREAD__ | ^ <built-in>:368:9: note: previous definition is here 368 | #define __SANITIZE_THREAD__ 1 | ^ drivers/ub/ubase/ubase_eq.c:785:6: warning: no previous prototype for function 'ubase_irq_table_free' [-Wmissing-prototypes] 785 | void ubase_irq_table_free(struct ubase_dev *udev) | ^ drivers/ub/ubase/ubase_eq.c:785:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 785 | void ubase_irq_table_free(struct ubase_dev *udev) | ^ | static 2 warnings generated. -- drivers/ub/ubase/ubase_cmd.c:757: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * When uninstalling, cmdq needs to be successfully sended as much as possible,
vim +/desc +551 drivers/ub/ubase/ubase_cmd.c 8d68017f37faef Xiongchuan Zhou 2025-09-12 547 8d68017f37faef Xiongchuan Zhou 2025-09-12 548 static void ubase_gen_single_bd_data(struct ubase_dev *udev, void **msg_data) 8d68017f37faef Xiongchuan Zhou 2025-09-12 549 { 8d68017f37faef Xiongchuan Zhou 2025-09-12 550 struct ubase_cmdq_ring *crq = &udev->hw.cmdq.crq; 8d68017f37faef Xiongchuan Zhou 2025-09-12 @551 struct ubase_cmdq_desc *desc; 8d68017f37faef Xiongchuan Zhou 2025-09-12 552 8d68017f37faef Xiongchuan Zhou 2025-09-12 553 desc = &crq->desc[crq->ci]; 8d68017f37faef Xiongchuan Zhou 2025-09-12 554 *msg_data = crq->desc[crq->ci].data; 8d68017f37faef Xiongchuan Zhou 2025-09-12 555 UBASE_MOVE_CRQ_RING_PTR(crq); 8d68017f37faef Xiongchuan Zhou 2025-09-12 556 } 8d68017f37faef Xiongchuan Zhou 2025-09-12 557 8d68017f37faef Xiongchuan Zhou 2025-09-12 558 static void ubase_gen_bd_data(struct ubase_dev *udev, u32 bd_num, 8d68017f37faef Xiongchuan Zhou 2025-09-12 559 void **msg_data, u32 msg_data_len) 8d68017f37faef Xiongchuan Zhou 2025-09-12 560 { 8d68017f37faef Xiongchuan Zhou 2025-09-12 561 if (bd_num == 1) { 8d68017f37faef Xiongchuan Zhou 2025-09-12 562 ubase_gen_single_bd_data(udev, msg_data); 8d68017f37faef Xiongchuan Zhou 2025-09-12 563 return; 8d68017f37faef Xiongchuan Zhou 2025-09-12 564 } 8d68017f37faef Xiongchuan Zhou 2025-09-12 565 8d68017f37faef Xiongchuan Zhou 2025-09-12 566 ubase_gen_multi_bd_data(udev, bd_num, msg_data, msg_data_len); 8d68017f37faef Xiongchuan Zhou 2025-09-12 567 } 8d68017f37faef Xiongchuan Zhou 2025-09-12 568 8d68017f37faef Xiongchuan Zhou 2025-09-12 569 static bool ubase_cmd_crq_empty(struct ubase_dev *udev, struct ubase_hw *hw) 8d68017f37faef Xiongchuan Zhou 2025-09-12 570 { 8d68017f37faef Xiongchuan Zhou 2025-09-12 571 hw->cmdq.crq.pi = ubase_read_dev(hw, UBASE_CRQ_TAIL_REG); 8d68017f37faef Xiongchuan Zhou 2025-09-12 572 8d68017f37faef Xiongchuan Zhou 2025-09-12 573 return hw->cmdq.crq.pi == hw->cmdq.crq.ci; 8d68017f37faef Xiongchuan Zhou 2025-09-12 574 } 8d68017f37faef Xiongchuan Zhou 2025-09-12 575 8d68017f37faef Xiongchuan Zhou 2025-09-12 @576 void ubase_cmd_crq_handler(struct ubase_dev *udev) 8d68017f37faef Xiongchuan Zhou 2025-09-12 577 { 8d68017f37faef Xiongchuan Zhou 2025-09-12 578 struct ubase_cmdq_ring *crq = &udev->hw.cmdq.crq; 8d68017f37faef Xiongchuan Zhou 2025-09-12 579 u32 msg_data_len; 8d68017f37faef Xiongchuan Zhou 2025-09-12 580 void *msg_data; 8d68017f37faef Xiongchuan Zhou 2025-09-12 581 u16 opcode; 8d68017f37faef Xiongchuan Zhou 2025-09-12 582 u8 bd_num; 8d68017f37faef Xiongchuan Zhou 2025-09-12 583 u8 flag; 8d68017f37faef Xiongchuan Zhou 2025-09-12 584 8d68017f37faef Xiongchuan Zhou 2025-09-12 585 while (!ubase_cmd_crq_empty(udev, &udev->hw)) { 8d68017f37faef Xiongchuan Zhou 2025-09-12 586 if (test_bit(UBASE_STATE_CMD_DISABLE, &udev->hw.state)) { 8d68017f37faef Xiongchuan Zhou 2025-09-12 587 ubase_warn(udev, 8d68017f37faef Xiongchuan Zhou 2025-09-12 588 "command queue needs re-initializing.\n"); 8d68017f37faef Xiongchuan Zhou 2025-09-12 589 return; 8d68017f37faef Xiongchuan Zhou 2025-09-12 590 } 8d68017f37faef Xiongchuan Zhou 2025-09-12 591 8d68017f37faef Xiongchuan Zhou 2025-09-12 592 opcode = crq->desc[crq->ci].opcode; 8d68017f37faef Xiongchuan Zhou 2025-09-12 593 bd_num = crq->desc[crq->ci].bd_num; 8d68017f37faef Xiongchuan Zhou 2025-09-12 594 flag = crq->desc[crq->ci].flag; 8d68017f37faef Xiongchuan Zhou 2025-09-12 595 msg_data_len = bd_num * sizeof(struct ubase_cmdq_desc) - 8d68017f37faef Xiongchuan Zhou 2025-09-12 596 UBASE_CMD_HEADER_LENGTH; 8d68017f37faef Xiongchuan Zhou 2025-09-12 597 8d68017f37faef Xiongchuan Zhou 2025-09-12 598 if (unlikely(!bd_num || !(flag & UBASE_CMD_FLAG_OUT))) { 8d68017f37faef Xiongchuan Zhou 2025-09-12 599 ubase_err(udev, 8d68017f37faef Xiongchuan Zhou 2025-09-12 600 "drop invalid crq message, opcode = 0x%x, bd_num = %u, flag = 0x%x.", 8d68017f37faef Xiongchuan Zhou 2025-09-12 601 opcode, bd_num, flag); 8d68017f37faef Xiongchuan Zhou 2025-09-12 602 UBASE_MOVE_CRQ_RING_PTR(crq); 8d68017f37faef Xiongchuan Zhou 2025-09-12 603 continue; 8d68017f37faef Xiongchuan Zhou 2025-09-12 604 } 8d68017f37faef Xiongchuan Zhou 2025-09-12 605 8d68017f37faef Xiongchuan Zhou 2025-09-12 606 ubase_gen_bd_data(udev, bd_num, &msg_data, msg_data_len); 8d68017f37faef Xiongchuan Zhou 2025-09-12 607 8d68017f37faef Xiongchuan Zhou 2025-09-12 608 ubase_cmd_exec_callback(udev, opcode, msg_data, 8d68017f37faef Xiongchuan Zhou 2025-09-12 609 msg_data_len); 8d68017f37faef Xiongchuan Zhou 2025-09-12 610 8d68017f37faef Xiongchuan Zhou 2025-09-12 611 ubase_free_bd_data(msg_data, bd_num); 8d68017f37faef Xiongchuan Zhou 2025-09-12 612 } 8d68017f37faef Xiongchuan Zhou 2025-09-12 613 8d68017f37faef Xiongchuan Zhou 2025-09-12 614 ubase_write_dev(&udev->hw, UBASE_CRQ_HEAD_REG, crq->ci); 8d68017f37faef Xiongchuan Zhou 2025-09-12 615 } 8d68017f37faef Xiongchuan Zhou 2025-09-12 616 :::::: The code at line 551 was first introduced by commit :::::: 8d68017f37faefe5f545dbfd994e1b5141ec06e1 ub: ubase: support for command process :::::: TO: Xiongchuan Zhou <zhouxiongchuan@h-partners.com> :::::: CC: Fengyan Mu <mufengyan@huawei.com> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot