drivers/firmware/efi/capsule-loader.c:91:12: warning: no previous prototype for 'efi_capsule_setup_info'

From: kernel test robot
Date: Wed Nov 10 2021 - 11:57:59 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: cb690f5238d71f543f4ce874aa59237cf53a877c
commit: a18b14d8886614b3c7d290c4cfc33389822b0535 riscv: Disable STACKPROTECTOR_PER_TASK if GCC_PLUGIN_RANDSTRUCT is enabled
date: 3 months ago
config: riscv-randconfig-r022-20211109 (attached as .config)
compiler: riscv32-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=a18b14d8886614b3c7d290c4cfc33389822b0535
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a18b14d8886614b3c7d290c4cfc33389822b0535
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=riscv

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

All warnings (new ones prefixed by >>):

>> drivers/firmware/efi/capsule-loader.c:91:12: warning: no previous prototype for 'efi_capsule_setup_info' [-Wmissing-prototypes]
91 | int __weak efi_capsule_setup_info(struct capsule_info *cap_info, void *kbuff,
| ^~~~~~~~~~~~~~~~~~~~~~
--
lib/test_hexdump.c: In function 'test_hexdump_prepare_test.constprop':
>> lib/test_hexdump.c:116:17: warning: 'strncpy' output truncated copying between 0 and 32 bytes from a string of length 32 [-Wstringop-truncation]
116 | strncpy(p, data_a, l);
| ^~~~~~~~~~~~~~~~~~~~~


vim +/efi_capsule_setup_info +91 drivers/firmware/efi/capsule-loader.c

65117f1aa1b2d14 Kweh, Hock Leong 2016-04-25 79
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 80 /**
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 81 * efi_capsule_setup_info - obtain the efi capsule header in the binary and
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 82 * setup capsule_info structure
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 83 * @cap_info: pointer to current instance of capsule_info structure
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 84 * @kbuff: a mapped first page buffer pointer
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 85 * @hdr_bytes: the total received number of bytes for efi header
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 86 *
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 87 * Platforms with non-standard capsule update mechanisms can override
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 88 * this __weak function so they can perform any required capsule
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 89 * image munging. See quark_quirk_function() for an example.
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 90 **/
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 @91 int __weak efi_capsule_setup_info(struct capsule_info *cap_info, void *kbuff,
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 92 size_t hdr_bytes)
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 93 {
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 94 /* Only process data block that is larger than efi header size */
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 95 if (hdr_bytes < sizeof(efi_capsule_header_t))
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 96 return 0;
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 97
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 98 memcpy(&cap_info->header, kbuff, sizeof(cap_info->header));
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 99 cap_info->total_size = cap_info->header.imagesize;
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 100
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 101 return __efi_capsule_setup_info(cap_info);
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 102 }
3fabd628d5ea24b Ard Biesheuvel 2017-06-02 103

:::::: The code at line 91 was first introduced by commit
:::::: 3fabd628d5ea24b02ddb1230ffca1df0f779f84e efi/capsule-loader: Redirect calls to efi_capsule_setup_info() via weak alias

:::::: TO: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
:::::: CC: Ingo Molnar <mingo@xxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip