linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/crypto/hisilicon/qm.c:1579:2: warning: 'strncpy' specified bound 64 equals destination size
@ 2020-06-03 13:32 kernel test robot
  2020-06-04  3:32 ` [PATCH] crypto: hisilicon - fix strncpy warning with strlcpy Zhangfei Gao
  0 siblings, 1 reply; 17+ messages in thread
From: kernel test robot @ 2020-06-03 13:32 UTC (permalink / raw)
  To: Zhangfei, Gao,
  Cc: kbuild-all, linux-kernel, Herbert Xu, Greg Kroah-Hartman,
	Jonathan Cameron, Zhou Wang

[-- Attachment #1: Type: text/plain, Size: 2964 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d6f9469a03d832dcd17041ed67774ffb5f3e73b3
commit: 9e00df7156e45e42c695ffc596b4bf1328d00516 crypto: hisilicon - register zip engine to uacce
date:   3 months ago
config: ia64-randconfig-r026-20200603 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 9e00df7156e45e42c695ffc596b4bf1328d00516
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In function 'qm_alloc_uacce',
inlined from 'hisi_qm_init' at drivers/crypto/hisilicon/qm.c:1660:8:
>> drivers/crypto/hisilicon/qm.c:1579:2: warning: 'strncpy' specified bound 64 equals destination size [-Wstringop-truncation]
1579 |  strncpy(interface.name, pdev->driver->name, sizeof(interface.name));
|  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/strncpy +1579 drivers/crypto/hisilicon/qm.c

  1567	
  1568	static int qm_alloc_uacce(struct hisi_qm *qm)
  1569	{
  1570		struct pci_dev *pdev = qm->pdev;
  1571		struct uacce_device *uacce;
  1572		unsigned long mmio_page_nr;
  1573		unsigned long dus_page_nr;
  1574		struct uacce_interface interface = {
  1575			.flags = UACCE_DEV_SVA,
  1576			.ops = &uacce_qm_ops,
  1577		};
  1578	
> 1579		strncpy(interface.name, pdev->driver->name, sizeof(interface.name));
  1580	
  1581		uacce = uacce_alloc(&pdev->dev, &interface);
  1582		if (IS_ERR(uacce))
  1583			return PTR_ERR(uacce);
  1584	
  1585		if (uacce->flags & UACCE_DEV_SVA) {
  1586			qm->use_sva = true;
  1587		} else {
  1588			/* only consider sva case */
  1589			uacce_remove(uacce);
  1590			qm->uacce = NULL;
  1591			return -EINVAL;
  1592		}
  1593	
  1594		uacce->is_vf = pdev->is_virtfn;
  1595		uacce->priv = qm;
  1596		uacce->algs = qm->algs;
  1597	
  1598		if (qm->ver == QM_HW_V1) {
  1599			mmio_page_nr = QM_DOORBELL_PAGE_NR;
  1600			uacce->api_ver = HISI_QM_API_VER_BASE;
  1601		} else {
  1602			mmio_page_nr = QM_DOORBELL_PAGE_NR +
  1603				QM_DOORBELL_SQ_CQ_BASE_V2 / PAGE_SIZE;
  1604			uacce->api_ver = HISI_QM_API_VER2_BASE;
  1605		}
  1606	
  1607		dus_page_nr = (PAGE_SIZE - 1 + qm->sqe_size * QM_Q_DEPTH +
  1608			       sizeof(struct qm_cqe) * QM_Q_DEPTH) >> PAGE_SHIFT;
  1609	
  1610		uacce->qf_pg_num[UACCE_QFRT_MMIO] = mmio_page_nr;
  1611		uacce->qf_pg_num[UACCE_QFRT_DUS]  = dus_page_nr;
  1612	
  1613		qm->uacce = uacce;
  1614	
  1615		return 0;
  1616	}
  1617	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37110 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-06-26  6:06 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 13:32 drivers/crypto/hisilicon/qm.c:1579:2: warning: 'strncpy' specified bound 64 equals destination size kernel test robot
2020-06-04  3:32 ` [PATCH] crypto: hisilicon - fix strncpy warning with strlcpy Zhangfei Gao
2020-06-04  3:39   ` Herbert Xu
2020-06-04  6:10     ` Zhangfei Gao
2020-06-04  6:18       ` Herbert Xu
2020-06-04  6:44         ` Zhangfei Gao
2020-06-04  6:50           ` Herbert Xu
2020-06-04 13:52             ` Zhou Wang
2020-06-05  9:34             ` Zhangfei Gao
2020-06-05 12:17               ` Herbert Xu
2020-06-05 15:26                 ` Zhangfei Gao
2020-06-05 15:49                   ` Eric Biggers
2020-06-06  1:42                     ` Zhangfei Gao
2020-06-07 13:03                 ` David Laight
2020-06-10  6:56                   ` Eric Biggers
2020-06-15  3:38   ` [PATCH v2] crypto: hisilicon - fix strncpy warning with strscpy Zhangfei Gao
2020-06-26  6:06     ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).