All of lore.kernel.org
 help / color / mirror / Atom feed
* [openeuler:OLK-5.10 2564/2564] drivers/crypto/hisilicon/qm.c:2755:9: warning: 'strncpy' specified bound depends on the length of the source argument
@ 2024-12-06 10:59 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-12-06 10:59 UTC (permalink / raw)
  To: kernel, JiangShui; +Cc: oe-kbuild-all

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@intel.com/config)
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@intel.com/reproduce)

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	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-06 10:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-06 10:59 [openeuler:OLK-5.10 2564/2564] drivers/crypto/hisilicon/qm.c:2755:9: warning: 'strncpy' specified bound depends on the length of the source argument kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.