Hi Weili,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 9cf5f60a8d57b2498fb9f9223825d6933b2d2fd5 commit: a1666f44c2250f7413e73e2f4c02cb2c01f9e3b0 [2564/2564] crypto: hisilicon/qm - support no-sva feature config: arm64-defconfig (https://download.01.org/0day-ci/archive/20241206/202412061809.pAIeGbw0-lkp@i...) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241206/202412061809.pAIeGbw0-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/202412061809.pAIeGbw0-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/crypto/hisilicon/qm.c: In function 'qm_alloc_uacce':
drivers/crypto/hisilicon/qm.c:2755:9: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-truncation]
2755 | strncpy(interface.name, pdev->driver->name, name_len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/crypto/hisilicon/qm.c:2748:20: note: length computed here 2748 | name_len = strlen(pdev->driver->name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncpy +2755 drivers/crypto/hisilicon/qm.c
2737 2738 static int qm_alloc_uacce(struct hisi_qm *qm) 2739 { 2740 struct pci_dev *pdev = qm->pdev; 2741 struct uacce_interface interface; 2742 struct uacce_device *uacce; 2743 int name_len; 2744 2745 if (!qm->use_uacce) 2746 return 0; 2747 2748 name_len = strlen(pdev->driver->name); 2749 if (name_len >= UACCE_MAX_NAME_SIZE) { 2750 pci_err(pdev, "The driver name(%d) is longer than %d!\n", 2751 name_len, UACCE_MAX_NAME_SIZE); 2752 return -EINVAL; 2753 } 2754
2755 strncpy(interface.name, pdev->driver->name, name_len);
2756 interface.name[name_len] = '\0'; 2757 2758 interface.flags = qm->use_iommu ? UACCE_DEV_IOMMU : UACCE_DEV_NOIOMMU; 2759 if (qm->mode == UACCE_MODE_SVA) { 2760 if (!qm->use_iommu) { 2761 pci_err(pdev, "iommu not support sva!\n"); 2762 return -EINVAL; 2763 } 2764 2765 interface.flags |= UACCE_DEV_SVA; 2766 } 2767 2768 interface.ops = &uacce_qm_ops; 2769 uacce = uacce_alloc(&pdev->dev, &interface); 2770 if (IS_ERR(uacce)) { 2771 pci_err(pdev, "fail to alloc uacce device\n!"); 2772 return PTR_ERR(uacce); 2773 } 2774 qm->uacce = uacce; 2775 2776 qm_uacce_base_init(qm); 2777 qm->uacce = uacce; 2778 INIT_LIST_HEAD(&qm->isolate_data.qm_hw_errs); 2779 mutex_init(&qm->isolate_data.isolate_lock); 2780 2781 return 0; 2782 } 2783