All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: drivers/s390/net/qeth_core_main.c:6194:9: warning: 'strncpy' specified bound 20 equals destination size
Date: Fri, 14 Jan 2022 02:34:53 +0800	[thread overview]
Message-ID: <202201140208.SgphJJdy-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   455e73a07f6e288b0061dfcf4fcf54fa9fe06458
commit: 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e init/Kconfig: make COMPILE_TEST depend on !S390
date:   1 year, 2 months ago
config: s390-randconfig-r016-20220113 (https://download.01.org/0day-ci/archive/20220114/202201140208.SgphJJdy-lkp(a)intel.com/config)
compiler: s390-linux-gcc (GCC) 11.2.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
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=334ef6ed06fa1a54e35296b77b693bcf6d63ee9e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash

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 >>):

   drivers/s390/net/qeth_core_main.c: In function 'qeth_dbf_longtext':
   drivers/s390/net/qeth_core_main.c:6066:9: warning: function 'qeth_dbf_longtext' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
    6066 |         vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args);
         |         ^~~~~~~~~
   drivers/s390/net/qeth_core_main.c: In function 'qeth_add_dbf_entry':
>> drivers/s390/net/qeth_core_main.c:6194:9: warning: 'strncpy' specified bound 20 equals destination size [-Wstringop-truncation]
    6194 |         strncpy(new_entry->dbf_name, name, DBF_NAME_LEN);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +6194 drivers/s390/net/qeth_core_main.c

819dc537fd7fcd Stefan Raspl 2013-01-21  6179  
819dc537fd7fcd Stefan Raspl 2013-01-21  6180  static int qeth_add_dbf_entry(struct qeth_card *card, char *name)
819dc537fd7fcd Stefan Raspl 2013-01-21  6181  {
819dc537fd7fcd Stefan Raspl 2013-01-21  6182  	struct qeth_dbf_entry *new_entry;
819dc537fd7fcd Stefan Raspl 2013-01-21  6183  
819dc537fd7fcd Stefan Raspl 2013-01-21  6184  	card->debug = debug_register(name, 2, 1, 8);
819dc537fd7fcd Stefan Raspl 2013-01-21  6185  	if (!card->debug) {
819dc537fd7fcd Stefan Raspl 2013-01-21  6186  		QETH_DBF_TEXT_(SETUP, 2, "%s", "qcdbf");
819dc537fd7fcd Stefan Raspl 2013-01-21  6187  		goto err;
819dc537fd7fcd Stefan Raspl 2013-01-21  6188  	}
819dc537fd7fcd Stefan Raspl 2013-01-21  6189  	if (debug_register_view(card->debug, &debug_hex_ascii_view))
819dc537fd7fcd Stefan Raspl 2013-01-21  6190  		goto err_dbg;
819dc537fd7fcd Stefan Raspl 2013-01-21  6191  	new_entry = kzalloc(sizeof(struct qeth_dbf_entry), GFP_KERNEL);
819dc537fd7fcd Stefan Raspl 2013-01-21  6192  	if (!new_entry)
819dc537fd7fcd Stefan Raspl 2013-01-21  6193  		goto err_dbg;
819dc537fd7fcd Stefan Raspl 2013-01-21 @6194  	strncpy(new_entry->dbf_name, name, DBF_NAME_LEN);
819dc537fd7fcd Stefan Raspl 2013-01-21  6195  	new_entry->dbf_info = card->debug;
819dc537fd7fcd Stefan Raspl 2013-01-21  6196  	mutex_lock(&qeth_dbf_list_mutex);
819dc537fd7fcd Stefan Raspl 2013-01-21  6197  	list_add(&new_entry->dbf_list, &qeth_dbf_list);
819dc537fd7fcd Stefan Raspl 2013-01-21  6198  	mutex_unlock(&qeth_dbf_list_mutex);
819dc537fd7fcd Stefan Raspl 2013-01-21  6199  
819dc537fd7fcd Stefan Raspl 2013-01-21  6200  	return 0;
819dc537fd7fcd Stefan Raspl 2013-01-21  6201  
819dc537fd7fcd Stefan Raspl 2013-01-21  6202  err_dbg:
819dc537fd7fcd Stefan Raspl 2013-01-21  6203  	debug_unregister(card->debug);
819dc537fd7fcd Stefan Raspl 2013-01-21  6204  err:
819dc537fd7fcd Stefan Raspl 2013-01-21  6205  	return -ENOMEM;
819dc537fd7fcd Stefan Raspl 2013-01-21  6206  }
819dc537fd7fcd Stefan Raspl 2013-01-21  6207  

:::::: The code at line 6194 was first introduced by commit
:::::: 819dc537fd7fcd799c5f7f85693d29e2635a84f9 qeth: Make s390dbf card entries persistent

:::::: TO: Stefan Raspl <raspl@linux.vnet.ibm.com>
:::::: CC: David S. Miller <davem@davemloft.net>

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: drivers/s390/net/qeth_core_main.c:6194:9: warning: 'strncpy' specified bound 20 equals destination size
Date: Fri, 14 Jan 2022 02:34:53 +0800	[thread overview]
Message-ID: <202201140208.SgphJJdy-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   455e73a07f6e288b0061dfcf4fcf54fa9fe06458
commit: 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e init/Kconfig: make COMPILE_TEST depend on !S390
date:   1 year, 2 months ago
config: s390-randconfig-r016-20220113 (https://download.01.org/0day-ci/archive/20220114/202201140208.SgphJJdy-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 11.2.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
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=334ef6ed06fa1a54e35296b77b693bcf6d63ee9e
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash

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 >>):

   drivers/s390/net/qeth_core_main.c: In function 'qeth_dbf_longtext':
   drivers/s390/net/qeth_core_main.c:6066:9: warning: function 'qeth_dbf_longtext' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
    6066 |         vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args);
         |         ^~~~~~~~~
   drivers/s390/net/qeth_core_main.c: In function 'qeth_add_dbf_entry':
>> drivers/s390/net/qeth_core_main.c:6194:9: warning: 'strncpy' specified bound 20 equals destination size [-Wstringop-truncation]
    6194 |         strncpy(new_entry->dbf_name, name, DBF_NAME_LEN);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +6194 drivers/s390/net/qeth_core_main.c

819dc537fd7fcd Stefan Raspl 2013-01-21  6179  
819dc537fd7fcd Stefan Raspl 2013-01-21  6180  static int qeth_add_dbf_entry(struct qeth_card *card, char *name)
819dc537fd7fcd Stefan Raspl 2013-01-21  6181  {
819dc537fd7fcd Stefan Raspl 2013-01-21  6182  	struct qeth_dbf_entry *new_entry;
819dc537fd7fcd Stefan Raspl 2013-01-21  6183  
819dc537fd7fcd Stefan Raspl 2013-01-21  6184  	card->debug = debug_register(name, 2, 1, 8);
819dc537fd7fcd Stefan Raspl 2013-01-21  6185  	if (!card->debug) {
819dc537fd7fcd Stefan Raspl 2013-01-21  6186  		QETH_DBF_TEXT_(SETUP, 2, "%s", "qcdbf");
819dc537fd7fcd Stefan Raspl 2013-01-21  6187  		goto err;
819dc537fd7fcd Stefan Raspl 2013-01-21  6188  	}
819dc537fd7fcd Stefan Raspl 2013-01-21  6189  	if (debug_register_view(card->debug, &debug_hex_ascii_view))
819dc537fd7fcd Stefan Raspl 2013-01-21  6190  		goto err_dbg;
819dc537fd7fcd Stefan Raspl 2013-01-21  6191  	new_entry = kzalloc(sizeof(struct qeth_dbf_entry), GFP_KERNEL);
819dc537fd7fcd Stefan Raspl 2013-01-21  6192  	if (!new_entry)
819dc537fd7fcd Stefan Raspl 2013-01-21  6193  		goto err_dbg;
819dc537fd7fcd Stefan Raspl 2013-01-21 @6194  	strncpy(new_entry->dbf_name, name, DBF_NAME_LEN);
819dc537fd7fcd Stefan Raspl 2013-01-21  6195  	new_entry->dbf_info = card->debug;
819dc537fd7fcd Stefan Raspl 2013-01-21  6196  	mutex_lock(&qeth_dbf_list_mutex);
819dc537fd7fcd Stefan Raspl 2013-01-21  6197  	list_add(&new_entry->dbf_list, &qeth_dbf_list);
819dc537fd7fcd Stefan Raspl 2013-01-21  6198  	mutex_unlock(&qeth_dbf_list_mutex);
819dc537fd7fcd Stefan Raspl 2013-01-21  6199  
819dc537fd7fcd Stefan Raspl 2013-01-21  6200  	return 0;
819dc537fd7fcd Stefan Raspl 2013-01-21  6201  
819dc537fd7fcd Stefan Raspl 2013-01-21  6202  err_dbg:
819dc537fd7fcd Stefan Raspl 2013-01-21  6203  	debug_unregister(card->debug);
819dc537fd7fcd Stefan Raspl 2013-01-21  6204  err:
819dc537fd7fcd Stefan Raspl 2013-01-21  6205  	return -ENOMEM;
819dc537fd7fcd Stefan Raspl 2013-01-21  6206  }
819dc537fd7fcd Stefan Raspl 2013-01-21  6207  

:::::: The code at line 6194 was first introduced by commit
:::::: 819dc537fd7fcd799c5f7f85693d29e2635a84f9 qeth: Make s390dbf card entries persistent

:::::: TO: Stefan Raspl <raspl@linux.vnet.ibm.com>
:::::: CC: David S. Miller <davem@davemloft.net>

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

             reply	other threads:[~2022-01-13 18:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13 18:34 kernel test robot [this message]
2022-01-13 18:34 ` drivers/s390/net/qeth_core_main.c:6194:9: warning: 'strncpy' specified bound 20 equals destination size kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202201140208.SgphJJdy-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.