* [intel-tdx:guest-filter-upstream 7/31] drivers/base/da_firmware.c:133:9: warning: 'strncpy' specified bound 64 equals destination size
@ 2023-02-07 15:32 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-02-07 15:32 UTC (permalink / raw)
To: Kuppuswamy Sathyanarayanan; +Cc: oe-kbuild-all
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-07 15:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-07 15:32 [intel-tdx:guest-filter-upstream 7/31] drivers/base/da_firmware.c:133:9: warning: 'strncpy' specified bound 64 equals destination size 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.