tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: d68dc6ee371ec5466be9b2d76bdca0b360940adc commit: 15ac0de239497e0a3497a106b9c0cc8795f0144a [1636/1636] LeapIOraid: Fix the compilation warnings in LeapIOraid driver in loongarch64 config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20241214/202412140904.HG96zLGT-lkp@i...) compiler: loongarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241214/202412140904.HG96zLGT-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/202412140904.HG96zLGT-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/scsi/leapioraid/leapioraid_func.c: In function 'leapioraid_base_request_irq':
drivers/scsi/leapioraid/leapioraid_func.c:2040:75: warning: '%u' directive output may be truncated writing between 1 and 3 bytes into a region of size between 1 and 26 [-Wformat-truncation=]
2040 | snprintf(reply_q->name, LEAPIORAID_NAME_LENGTH, "%s%u-msix%u", | ^~ drivers/scsi/leapioraid/leapioraid_func.c:2040:65: note: directive argument in the range [0, 254] 2040 | snprintf(reply_q->name, LEAPIORAID_NAME_LENGTH, "%s%u-msix%u", | ^~~~~~~~~~~~~ drivers/scsi/leapioraid/leapioraid_func.c:2040:17: note: 'snprintf' output between 8 and 35 bytes into a destination of size 32 2040 | snprintf(reply_q->name, LEAPIORAID_NAME_LENGTH, "%s%u-msix%u", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2041 | ioc->driver_name, ioc->id, index); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/scsi/leapioraid/leapioraid_func.c:2031:70: warning: '-mq-poll' directive output may be truncated writing 8 bytes into a region of size between 6 and 31 [-Wformat-truncation=] 2031 | snprintf(reply_q->name, LEAPIORAID_NAME_LENGTH, "%s%u-mq-poll%u", | ^~~~~~~~ drivers/scsi/leapioraid/leapioraid_func.c:2031:65: note: directive argument in the range [0, 255] 2031 | snprintf(reply_q->name, LEAPIORAID_NAME_LENGTH, "%s%u-mq-poll%u", | ^~~~~~~~~~~~~~~~ drivers/scsi/leapioraid/leapioraid_func.c:2031:17: note: 'snprintf' output between 11 and 38 bytes into a destination of size 32 2031 | snprintf(reply_q->name, LEAPIORAID_NAME_LENGTH, "%s%u-mq-poll%u", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2032 | ioc->driver_name, ioc->id, qid); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +2040 drivers/scsi/leapioraid/leapioraid_func.c
2013 2014 static int 2015 leapioraid_base_request_irq(struct LEAPIORAID_ADAPTER *ioc, u8 index) 2016 { 2017 struct leapioraid_adapter_reply_queue *reply_q; 2018 int r; 2019 u8 qid; 2020 2021 reply_q = kzalloc(sizeof(struct leapioraid_adapter_reply_queue), 2022 GFP_KERNEL); 2023 if (!reply_q) 2024 return -ENOMEM; 2025 2026 reply_q->ioc = ioc; 2027 reply_q->msix_index = index; 2028 atomic_set(&reply_q->busy, 0); 2029 if (index >= ioc->iopoll_q_start_index) { 2030 qid = index - ioc->iopoll_q_start_index; 2031 snprintf(reply_q->name, LEAPIORAID_NAME_LENGTH, "%s%u-mq-poll%u", 2032 ioc->driver_name, ioc->id, qid); 2033 reply_q->is_blk_mq_poll_q = 1; 2034 ioc->blk_mq_poll_queues[qid].reply_q = reply_q; 2035 INIT_LIST_HEAD(&reply_q->list); 2036 list_add_tail(&reply_q->list, &ioc->reply_queue_list); 2037 return 0; 2038 } 2039 if (ioc->msix_enable)
2040 snprintf(reply_q->name, LEAPIORAID_NAME_LENGTH, "%s%u-msix%u",
2041 ioc->driver_name, ioc->id, index); 2042 else 2043 snprintf(reply_q->name, LEAPIORAID_NAME_LENGTH, "%s%d", 2044 ioc->driver_name, ioc->id); 2045 r = request_irq(pci_irq_vector(ioc->pdev, index), leapioraid_base_interrupt, 2046 IRQF_SHARED, reply_q->name, reply_q); 2047 if (r) { 2048 pr_err("%s unable to allocate interrupt %d!\n", reply_q->name, 2049 pci_irq_vector(ioc->pdev, index)); 2050 kfree(reply_q); 2051 return -EBUSY; 2052 } 2053 2054 INIT_LIST_HEAD(&reply_q->list); 2055 list_add_tail(&reply_q->list, &ioc->reply_queue_list); 2056 return 0; 2057 } 2058