* [linux-platform-drivers-x86:review-hans 37/38] drivers/platform/x86/firmware_attributes_class.c:16:5: warning: no previous prototype for function 'fw_attributes_class_get'
@ 2021-05-27 15:44 kernel test robot
2021-05-27 17:31 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-05-27 15:44 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 5225 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git review-hans
head: 9972d91cd41540a1890435034b62653c98da4261
commit: 8535b9dea34f00781758999285cea8ab82bb0a2f [37/38] platform/x86: dell-wmi-sysman: Use firmware_attributes_class helper
config: x86_64-randconfig-r032-20210527 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 6505c630407c5feec818f0bb1c284f9eeebf2071)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?id=8535b9dea34f00781758999285cea8ab82bb0a2f
git remote add linux-platform-drivers-x86 https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git
git fetch --no-tags linux-platform-drivers-x86 review-hans
git checkout 8535b9dea34f00781758999285cea8ab82bb0a2f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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/platform/x86/firmware_attributes_class.c:16:5: warning: no previous prototype for function 'fw_attributes_class_get' [-Wmissing-prototypes]
int fw_attributes_class_get(struct class **fw_attr_class)
^
drivers/platform/x86/firmware_attributes_class.c:16:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int fw_attributes_class_get(struct class **fw_attr_class)
^
static
>> drivers/platform/x86/firmware_attributes_class.c:35:5: warning: no previous prototype for function 'fw_attributes_class_put' [-Wmissing-prototypes]
int fw_attributes_class_put(void)
^
drivers/platform/x86/firmware_attributes_class.c:35:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int fw_attributes_class_put(void)
^
static
2 warnings generated.
vim +/fw_attributes_class_get +16 drivers/platform/x86/firmware_attributes_class.c
6786a9252a615d Mark Pearson 2021-05-26 15
6786a9252a615d Mark Pearson 2021-05-26 @16 int fw_attributes_class_get(struct class **fw_attr_class)
6786a9252a615d Mark Pearson 2021-05-26 17 {
6786a9252a615d Mark Pearson 2021-05-26 18 int err;
6786a9252a615d Mark Pearson 2021-05-26 19
6786a9252a615d Mark Pearson 2021-05-26 20 mutex_lock(&fw_attr_lock);
6786a9252a615d Mark Pearson 2021-05-26 21 if (!fw_attr_inuse) { /*first time class is being used*/
6786a9252a615d Mark Pearson 2021-05-26 22 err = class_register(&firmware_attributes_class);
6786a9252a615d Mark Pearson 2021-05-26 23 if (err) {
6786a9252a615d Mark Pearson 2021-05-26 24 mutex_unlock(&fw_attr_lock);
6786a9252a615d Mark Pearson 2021-05-26 25 return err;
6786a9252a615d Mark Pearson 2021-05-26 26 }
6786a9252a615d Mark Pearson 2021-05-26 27 }
6786a9252a615d Mark Pearson 2021-05-26 28 fw_attr_inuse++;
6786a9252a615d Mark Pearson 2021-05-26 29 *fw_attr_class = &firmware_attributes_class;
6786a9252a615d Mark Pearson 2021-05-26 30 mutex_unlock(&fw_attr_lock);
6786a9252a615d Mark Pearson 2021-05-26 31 return 0;
6786a9252a615d Mark Pearson 2021-05-26 32 }
6786a9252a615d Mark Pearson 2021-05-26 33 EXPORT_SYMBOL_GPL(fw_attributes_class_get);
6786a9252a615d Mark Pearson 2021-05-26 34
6786a9252a615d Mark Pearson 2021-05-26 @35 int fw_attributes_class_put(void)
6786a9252a615d Mark Pearson 2021-05-26 36 {
6786a9252a615d Mark Pearson 2021-05-26 37 mutex_lock(&fw_attr_lock);
6786a9252a615d Mark Pearson 2021-05-26 38 if (!fw_attr_inuse) {
6786a9252a615d Mark Pearson 2021-05-26 39 mutex_unlock(&fw_attr_lock);
6786a9252a615d Mark Pearson 2021-05-26 40 return -EINVAL;
6786a9252a615d Mark Pearson 2021-05-26 41 }
6786a9252a615d Mark Pearson 2021-05-26 42 fw_attr_inuse--;
6786a9252a615d Mark Pearson 2021-05-26 43 if (!fw_attr_inuse) /* No more consumers */
6786a9252a615d Mark Pearson 2021-05-26 44 class_unregister(&firmware_attributes_class);
6786a9252a615d Mark Pearson 2021-05-26 45 mutex_unlock(&fw_attr_lock);
6786a9252a615d Mark Pearson 2021-05-26 46 return 0;
6786a9252a615d Mark Pearson 2021-05-26 47 }
6786a9252a615d Mark Pearson 2021-05-26 48 EXPORT_SYMBOL_GPL(fw_attributes_class_put);
6786a9252a615d Mark Pearson 2021-05-26 49
:::::: The code at line 16 was first introduced by commit
:::::: 6786a9252a615d07fe26c147fb3d554f12e6a449 platform/x86: firmware_attributes_class: Create helper file for handling firmware-attributes class registration events
:::::: TO: Mark Pearson <markpearson@lenovo.com>
:::::: CC: Hans de Goede <hdegoede@redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29969 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-platform-drivers-x86:review-hans 37/38] drivers/platform/x86/firmware_attributes_class.c:16:5: warning: no previous prototype for function 'fw_attributes_class_get'
2021-05-27 15:44 [linux-platform-drivers-x86:review-hans 37/38] drivers/platform/x86/firmware_attributes_class.c:16:5: warning: no previous prototype for function 'fw_attributes_class_get' kernel test robot
@ 2021-05-27 17:31 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2021-05-27 17:31 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2867 bytes --]
Hi Mark,
On 5/27/21 5:44 PM, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git review-hans
> head: 9972d91cd41540a1890435034b62653c98da4261
> commit: 8535b9dea34f00781758999285cea8ab82bb0a2f [37/38] platform/x86: dell-wmi-sysman: Use firmware_attributes_class helper
> config: x86_64-randconfig-r032-20210527 (attached as .config)
> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 6505c630407c5feec818f0bb1c284f9eeebf2071)
> 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
> # install x86_64 cross compiling tool for clang build
> # apt-get install binutils-x86-64-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?id=8535b9dea34f00781758999285cea8ab82bb0a2f
> git remote add linux-platform-drivers-x86 https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git
> git fetch --no-tags linux-platform-drivers-x86 review-hans
> git checkout 8535b9dea34f00781758999285cea8ab82bb0a2f
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
>
> 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/platform/x86/firmware_attributes_class.c:16:5: warning: no previous prototype for function 'fw_attributes_class_get' [-Wmissing-prototypes]
> int fw_attributes_class_get(struct class **fw_attr_class)
> ^
> drivers/platform/x86/firmware_attributes_class.c:16:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
> int fw_attributes_class_get(struct class **fw_attr_class)
> ^
> static
>>> drivers/platform/x86/firmware_attributes_class.c:35:5: warning: no previous prototype for function 'fw_attributes_class_put' [-Wmissing-prototypes]
> int fw_attributes_class_put(void)
> ^
> drivers/platform/x86/firmware_attributes_class.c:35:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
> int fw_attributes_class_put(void)
> ^
> static
> 2 warnings generated.
Let me decode these arcane warnings for you :)
These warnings are being issues because there is no previous prototype declaration for these functions; and this is caused by drivers/platform/x86/firmware_attributes_class.c missing an:
#include "firmware_attributes_class.h"
If you add that to the discussed v5 of this series then these warning should go away.
Regards,
Hans
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-27 17:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27 15:44 [linux-platform-drivers-x86:review-hans 37/38] drivers/platform/x86/firmware_attributes_class.c:16:5: warning: no previous prototype for function 'fw_attributes_class_get' kernel test robot
2021-05-27 17:31 ` Hans de Goede
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.