All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [intel-tdx:guest-filter-upstream 7/31] drivers/base/da_firmware.c:133:9: warning: 'strncpy' specified bound 64 equals destination size
Date: Tue, 7 Feb 2023 23:32:53 +0800	[thread overview]
Message-ID: <202302072357.ecVSWGbC-lkp@intel.com> (raw)

tree:   https://github.com/intel/tdx.git guest-filter-upstream
head:   fd61f2d2a82f5c0c284fa3f074bae5016c39e7bc
commit: 2918c8a83642b317e92706dcb7ee6ee4443f3266 [7/31] driver core: Add command line option to update device authorization list
config: arm-cerfcube_defconfig (https://download.01.org/0day-ci/archive/20230207/202302072357.ecVSWGbC-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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://github.com/intel/tdx/commit/2918c8a83642b317e92706dcb7ee6ee4443f3266
        git remote add intel-tdx https://github.com/intel/tdx.git
        git fetch --no-tags intel-tdx guest-filter-upstream
        git checkout 2918c8a83642b317e92706dcb7ee6ee4443f3266
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/base/

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

All warnings (new ones prefixed by >>):

   drivers/base/da_firmware.c:166:8: warning: no previous prototype for 'parse_firmware_devices' [-Wmissing-prototypes]
     166 | size_t parse_firmware_devices(struct da_bus_node *node, void *data)
         |        ^~~~~~~~~~~~~~~~~~~~~~
   drivers/base/da_firmware.c: In function 'parse_cmdline_data':
   drivers/base/da_firmware.c:377:25: warning: variable 'ids' set but not used [-Wunused-but-set-variable]
     377 |         char *k, *bus, *ids;
         |                         ^~~
   drivers/base/da_firmware.c: In function 'alloc_bus_node':
>> drivers/base/da_firmware.c:133:9: warning: 'strncpy' specified bound 64 equals destination size [-Wstringop-truncation]
     133 |         strncpy(node->name, bus, NAME_LEN);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/strncpy +133 drivers/base/da_firmware.c

304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  123  
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  124  /* Allocate DA firmware bus node and initialize it based on struct da_bus_hdr */
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  125  static struct da_bus_node *alloc_bus_node(char *bus, u32 count)
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  126  {
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  127  	struct da_bus_node *node;
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  128  
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  129  	node = kzalloc(sizeof(*node), GFP_KERNEL);
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  130  	if (!node)
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  131  		return NULL;
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  132  
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22 @133  	strncpy(node->name, bus, NAME_LEN);
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  134  	node->count = count;
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  135  
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  136  	if (!strncmp(node->name, "pci", 3)) {
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  137  		node->match_device = pci_match_device;
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  138  		node->print_devices = pci_print_devices;
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  139  	} else {
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  140  		node->match_device = bus_match_device;
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  141  		node->print_devices = bus_print_devices;
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  142  	}
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  143  
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  144  	return node;
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  145  }
304ef1a77b5f51 Kuppuswamy Sathyanarayanan 2022-12-22  146  

:::::: The code at line 133 was first introduced by commit
:::::: 304ef1a77b5f5171d3e3ceb4d315ac79b135ab92 driver core: Add support to parse device authorize firmware

:::::: TO: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
:::::: CC: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

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

                 reply	other threads:[~2023-02-07 15:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202302072357.ecVSWGbC-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    /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.