All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [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'
Date: Thu, 27 May 2021 23:44:50 +0800	[thread overview]
Message-ID: <202105272347.ko0CMhYf-lkp@intel.com> (raw)

[-- 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 --]

             reply	other threads:[~2021-05-27 15:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 15:44 kernel test robot [this message]
2021-05-27 17:31 ` [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' Hans de Goede

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=202105272347.ko0CMhYf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.