[openeuler:OLK-6.6 3485/3485] drivers/net/ethernet/huawei/bma/kbox_drv/kbox_printk.c:281:57: warning: diagnostic behavior may be improved by adding the 'format(printf, 1, 2)' attribute to the declaration of 'kbox_dump_printk_info'
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 36141432a37f7dedddde8825e724b07ce3a440fb commit: cd2978286f40089fcd83f74ffdff733bfbe1e52a [3485/3485] Huawei BMA: Adding Huawei BMA driver: host_kbox_drv config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20251209/202512090240.NdebMvOZ-lkp@i...) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 000e46219ba1ee53fc42d35e00c314c2807e8b14) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251209/202512090240.NdebMvOZ-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/202512090240.NdebMvOZ-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from drivers/net/ethernet/huawei/bma/kbox_drv/kbox_printk.c:20: In file included from drivers/net/ethernet/huawei/bma/kbox_drv/kbox_include.h:21: In file included from include/linux/netdevice.h:38: In file included from include/net/net_namespace.h:43: In file included from include/linux/skbuff.h:17: In file included from include/linux/bvec.h:10: In file included from include/linux/highmem.h:8: In file included from include/linux/cacheflush.h:5: In file included from arch/loongarch/include/asm/cacheflush.h:8: In file included from include/linux/mm.h:2204: include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 509 | item]; | ~~~~ include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 516 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 528 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 536 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 537 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/huawei/bma/kbox_drv/kbox_printk.c:281:57: warning: diagnostic behavior may be improved by adding the 'format(printf, 1, 2)' attribute to the declaration of 'kbox_dump_printk_info' [-Wmissing-format-attribute] 281 | num = vsnprintf(tmp_buf, sizeof(tmp_buf) - 1, fmt, args); | ^ drivers/net/ethernet/huawei/bma/kbox_drv/kbox_printk.h:30:6: note: 'kbox_dump_printk_info' declared here 30 | int kbox_dump_printk_info(const char *fmt, ...); | ^ 6 warnings generated. -- In file included from drivers/net/ethernet/huawei/bma/kbox_drv/kbox_panic.c:20: In file included from drivers/net/ethernet/huawei/bma/kbox_drv/kbox_include.h:21: In file included from include/linux/netdevice.h:38: In file included from include/net/net_namespace.h:43: In file included from include/linux/skbuff.h:17: In file included from include/linux/bvec.h:10: In file included from include/linux/highmem.h:8: In file included from include/linux/cacheflush.h:5: In file included from arch/loongarch/include/asm/cacheflush.h:8: In file included from include/linux/mm.h:2204: include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 509 | item]; | ~~~~ include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 516 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 528 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 536 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 537 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/huawei/bma/kbox_drv/kbox_panic.c:85:57: warning: diagnostic behavior may be improved by adding the 'format(printf, 1, 2)' attribute to the declaration of 'kbox_dump_painc_info' [-Wmissing-format-attribute] 85 | num = vsnprintf(tmp_buf, sizeof(tmp_buf) - 1, fmt, args); | ^ drivers/net/ethernet/huawei/bma/kbox_drv/kbox_panic.h:21:5: note: 'kbox_dump_painc_info' declared here 21 | int kbox_dump_painc_info(const char *fmt, ...); | ^ 6 warnings generated.
vim +281 drivers/net/ethernet/huawei/bma/kbox_drv/kbox_printk.c 270 271 int kbox_dump_printk_info(const char *fmt, ...) 272 { 273 va_list args; 274 int num = 0; 275 char tmp_buf[TMP_BUF_SIZE] = { }; 276 277 if (g_printk_init_ok != KBOX_TRUE) 278 return 0; 279 280 va_start(args, fmt);
281 num = vsnprintf(tmp_buf, sizeof(tmp_buf) - 1, fmt, args); 282 if (num >= 0) 283 (void)kbox_duplicate_printk_info(tmp_buf, num); 284 285 va_end(args); 286 287 return num; 288 } 289
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot