Re: [PATCH v1 3/3] Bluetooth: NXP: Add protocol support for NXP Bluetooth chipsets

kernel test robot
2023-01-25T00:44:38Z

Hi Neeraj,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on bluetooth/master tty/tty-testing tty/tty-next tty/tty-linus linus/master v6.2-rc5 next-20230124]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Neeraj-Sanjay-Kale/serdev-Add-method-to-assert-break/20230125-015108
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
patch link: https://lore.kernel.org/r/20230124174714.2775680-4-neeraj.sanjaykale%40nxp.com
patch subject: [PATCH v1 3/3] Bluetooth: NXP: Add protocol support for NXP Bluetooth chipsets
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20230125/202301250824.iVWBIZts-lkp@intel.com/config)
compiler: sparc64-linux-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-lab-lkp/linux/commit/e5f775c45ec84de38a4cadfb115c488cb44e5943
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Neeraj-Sanjay-Kale/serdev-Add-method-to-assert-break/20230125-015108
git checkout e5f775c45ec84de38a4cadfb115c488cb44e5943
# 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=sparc olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc SHELL=/bin/bash drivers/

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/bluetooth/btnxp.c: In function 'nxp_load_fw_params_for_chip_id':
>> drivers/bluetooth/btnxp.c:439:25: warning: 'strncpy' specified bound 50 equals destination size [-Wstringop-truncation]
439 | strncpy(nxpdev->fw_name, fw_mod_params[i].fw_name, MAX_FW_FILE_NAME_LEN);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/strncpy +439 drivers/bluetooth/btnxp.c

431
432 static int nxp_load_fw_params_for_chip_id(u16 chip_id, struct hci_dev *hdev)
433 {
434 struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev);
435 int i;
436
437 for (i = 0; i < MAX_NO_OF_CHIPS_SUPPORT; i++) {
438 if (chip_id == fw_mod_params[i].chip_id) {
> 439 strncpy(nxpdev->fw_name, fw_mod_params[i].fw_name, MAX_FW_FILE_NAME_LEN);
440 nxpdev->oper_speed = fw_mod_params[i].oper_speed;
441 nxpdev->fw_dnld_pri_baudrate = fw_mod_params[i].fw_dnld_pri_baudrate;
442 nxpdev->fw_dnld_sec_baudrate = fw_mod_params[i].fw_dnld_sec_baudrate;
443 nxpdev->fw_init_baudrate = fw_mod_params[i].fw_init_baudrate;
444 break;
445 }
446 }
447 if (i == MAX_NO_OF_CHIPS_SUPPORT) {
448 if (chip_id == 0xffff)
449 BT_ERR("%s does not contain entry for 'legacy_chip'", BT_FW_CONF_FILE);
450 else
451 BT_ERR("Unsupported chip signature: %04X", chip_id);
452 clear_bit(BTNXPUART_FW_DOWNLOADING, &nxpdev->tx_state);
453 return -ENOENT;
454 }
455 return 0;
456 }
457

--
0-DAY CI Kernel Test Service