linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent
@ 2021-08-21  0:05 Phillip Potter
  2021-08-21  3:10 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Phillip Potter @ 2021-08-21  0:05 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, martin, straube.linux, Larry.Finger

Remove forward declaration of Efuse_Read1ByteFromFakeContent function
from core/rtw_efuse.c, as the function is defined in full directly
after this and therefore this forward declaration is redundant.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
---
 drivers/staging/r8188eu/core/rtw_efuse.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_efuse.c b/drivers/staging/r8188eu/core/rtw_efuse.c
index decccf7622f0..45b757ab64e1 100644
--- a/drivers/staging/r8188eu/core/rtw_efuse.c
+++ b/drivers/staging/r8188eu/core/rtw_efuse.c
@@ -29,12 +29,6 @@ u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN] = {0};
 #define REG_EFUSE_CTRL		0x0030
 #define EFUSE_CTRL			REG_EFUSE_CTRL		/*  E-Fuse Control. */
 /*  */
-
-bool
-Efuse_Read1ByteFromFakeContent(
-			struct adapter *pAdapter,
-			u16 Offset,
-		u8 *Value);
 bool
 Efuse_Read1ByteFromFakeContent(
 			struct adapter *pAdapter,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent
  2021-08-21  0:05 [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent Phillip Potter
@ 2021-08-21  3:10 ` kernel test robot
  2021-08-21  3:17 ` Fabio M. De Francesco
  2021-08-21 14:45 ` Larry Finger
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-08-21  3:10 UTC (permalink / raw)
  To: Phillip Potter, gregkh
  Cc: kbuild-all, linux-staging, linux-kernel, martin, straube.linux,
	Larry.Finger

[-- Attachment #1: Type: text/plain, Size: 3411 bytes --]

Hi Phillip,

I love your patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/Phillip-Potter/staging-r8188eu-remove-forward-declaration-of-Efuse_Read1ByteFromFakeContent/20210821-080835
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 093991aaadf0fbb34184fa37a46e7a157da3f386
config: sh-allmodconfig (attached as .config)
compiler: sh4-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://github.com/0day-ci/linux/commit/195b942818ec8dcaa8f3ffd7e8c623d172d75a50
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Phillip-Potter/staging-r8188eu-remove-forward-declaration-of-Efuse_Read1ByteFromFakeContent/20210821-080835
        git checkout 195b942818ec8dcaa8f3ffd7e8c623d172d75a50
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sh 

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/staging/r8188eu/core/rtw_efuse.c:33:1: warning: no previous prototype for 'Efuse_Read1ByteFromFakeContent' [-Wmissing-prototypes]
      33 | Efuse_Read1ByteFromFakeContent(
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
   Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
   Selected by
   - SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
   - SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC


vim +/Efuse_Read1ByteFromFakeContent +33 drivers/staging/r8188eu/core/rtw_efuse.c

15865124feed88 Phillip Potter 2021-07-28  27  
15865124feed88 Phillip Potter 2021-07-28  28  /*  */
15865124feed88 Phillip Potter 2021-07-28  29  #define REG_EFUSE_CTRL		0x0030
15865124feed88 Phillip Potter 2021-07-28  30  #define EFUSE_CTRL			REG_EFUSE_CTRL		/*  E-Fuse Control. */
15865124feed88 Phillip Potter 2021-07-28  31  /*  */
15865124feed88 Phillip Potter 2021-07-28  32  bool
15865124feed88 Phillip Potter 2021-07-28 @33  Efuse_Read1ByteFromFakeContent(
15865124feed88 Phillip Potter 2021-07-28  34  			struct adapter *pAdapter,
15865124feed88 Phillip Potter 2021-07-28  35  			u16 Offset,
15865124feed88 Phillip Potter 2021-07-28  36  		u8 *Value)
15865124feed88 Phillip Potter 2021-07-28  37  {
15865124feed88 Phillip Potter 2021-07-28  38  	if (Offset >= EFUSE_MAX_HW_SIZE)
15865124feed88 Phillip Potter 2021-07-28  39  		return false;
15865124feed88 Phillip Potter 2021-07-28  40  	if (fakeEfuseBank == 0)
15865124feed88 Phillip Potter 2021-07-28  41  		*Value = fakeEfuseContent[Offset];
15865124feed88 Phillip Potter 2021-07-28  42  	else
15865124feed88 Phillip Potter 2021-07-28  43  		*Value = fakeBTEfuseContent[fakeEfuseBank - 1][Offset];
15865124feed88 Phillip Potter 2021-07-28  44  	return true;
15865124feed88 Phillip Potter 2021-07-28  45  }
15865124feed88 Phillip Potter 2021-07-28  46  

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 55027 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent
  2021-08-21  0:05 [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent Phillip Potter
  2021-08-21  3:10 ` kernel test robot
@ 2021-08-21  3:17 ` Fabio M. De Francesco
  2021-08-21  8:30   ` Michael Straube
  2021-08-21 14:45 ` Larry Finger
  2 siblings, 1 reply; 7+ messages in thread
From: Fabio M. De Francesco @ 2021-08-21  3:17 UTC (permalink / raw)
  To: gregkh, Phillip Potter
  Cc: linux-staging, linux-kernel, martin, straube.linux, Larry.Finger

On Saturday, August 21, 2021 2:05:08 AM CEST Phillip Potter wrote:
> Remove forward declaration of Efuse_Read1ByteFromFakeContent function
> from core/rtw_efuse.c, as the function is defined in full directly
> after this and therefore this forward declaration is redundant.
> 
> Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
> ---
>  drivers/staging/r8188eu/core/rtw_efuse.c | 6 ------
>  1 file changed, 6 deletions(-)

Philip,

It's pretty clear that this function has only a translation unit visibility.
Why don't you make it clear by defining it with storage class "static"?

Thanks,

Fabio



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent
  2021-08-21  3:17 ` Fabio M. De Francesco
@ 2021-08-21  8:30   ` Michael Straube
  2021-08-21 10:42     ` Phillip Potter
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Straube @ 2021-08-21  8:30 UTC (permalink / raw)
  To: Fabio M. De Francesco, gregkh, Phillip Potter
  Cc: linux-staging, linux-kernel, martin, Larry.Finger



On 8/21/21 5:17 AM, Fabio M. De Francesco wrote:
> On Saturday, August 21, 2021 2:05:08 AM CEST Phillip Potter wrote:
>> Remove forward declaration of Efuse_Read1ByteFromFakeContent function
>> from core/rtw_efuse.c, as the function is defined in full directly
>> after this and therefore this forward declaration is redundant.
>>
>> Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
>> ---
>>   drivers/staging/r8188eu/core/rtw_efuse.c | 6 ------
>>   1 file changed, 6 deletions(-)
> 
> Philip,
> 
> It's pretty clear that this function has only a translation unit visibility.
> Why don't you make it clear by defining it with storage class "static"?
> 
> Thanks,
> 
> Fabio
> 
> 

Hi Phillip,

I agree with Fabio, making the function static avoids the 
[-Wmissing-prototypes] warning and makes it clear that it is only used 
in this file.

Thanks,

Michael

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent
  2021-08-21  8:30   ` Michael Straube
@ 2021-08-21 10:42     ` Phillip Potter
  0 siblings, 0 replies; 7+ messages in thread
From: Phillip Potter @ 2021-08-21 10:42 UTC (permalink / raw)
  To: Michael Straube, Fabio M. De Francesco
  Cc: linux-staging, linux-kernel, martin, Larry.Finger, gregkh

On Sat, 2021-08-21 at 10:30 +0200, Michael Straube wrote:
> 
> 
> On 8/21/21 5:17 AM, Fabio M. De Francesco wrote:
> > On Saturday, August 21, 2021 2:05:08 AM CEST Phillip Potter wrote:
> > > Remove forward declaration of Efuse_Read1ByteFromFakeContent
> > > function
> > > from core/rtw_efuse.c, as the function is defined in full
> > > directly
> > > after this and therefore this forward declaration is redundant.
> > > 
> > > Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
> > > ---
> > >   drivers/staging/r8188eu/core/rtw_efuse.c | 6 ------
> > >   1 file changed, 6 deletions(-)
> > 
> > Philip,
> > 
> > It's pretty clear that this function has only a translation unit
> > visibility.
> > Why don't you make it clear by defining it with storage class
> > "static"?
> > 
> > Thanks,
> > 
> > Fabio
> > 
> > 
> 
> Hi Phillip,
> 
> I agree with Fabio, making the function static avoids the 
> [-Wmissing-prototypes] warning and makes it clear that it is only
> used 
> in this file.
> 
> Thanks,
> 
> Michael

Dear Michael and Fabio,

You're both absolutely right, thank you for the feedback. It did occur
to me at the time that I could just make this static, and indeed the
change introduces a kernel test robot warning as it is currently, due
to -Wmissing-prototypes as mentioned. I shall rework, many thanks.

Regards,
Phil


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent
  2021-08-21  0:05 [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent Phillip Potter
  2021-08-21  3:10 ` kernel test robot
  2021-08-21  3:17 ` Fabio M. De Francesco
@ 2021-08-21 14:45 ` Larry Finger
  2021-08-21 17:10   ` Phillip Potter
  2 siblings, 1 reply; 7+ messages in thread
From: Larry Finger @ 2021-08-21 14:45 UTC (permalink / raw)
  To: Phillip Potter, gregkh; +Cc: linux-staging, linux-kernel, martin, straube.linux

On 8/20/21 7:05 PM, Phillip Potter wrote:
> Remove forward declaration of Efuse_Read1ByteFromFakeContent function
> from core/rtw_efuse.c, as the function is defined in full directly
> after this and therefore this forward declaration is redundant.
> 
> Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
> ---
>   drivers/staging/r8188eu/core/rtw_efuse.c | 6 ------
>   1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_efuse.c b/drivers/staging/r8188eu/core/rtw_efuse.c
> index decccf7622f0..45b757ab64e1 100644
> --- a/drivers/staging/r8188eu/core/rtw_efuse.c
> +++ b/drivers/staging/r8188eu/core/rtw_efuse.c
> @@ -29,12 +29,6 @@ u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN] = {0};
>   #define REG_EFUSE_CTRL		0x0030
>   #define EFUSE_CTRL			REG_EFUSE_CTRL		/*  E-Fuse Control. */
>   /*  */
> -
> -bool
> -Efuse_Read1ByteFromFakeContent(
> -			struct adapter *pAdapter,
> -			u16 Offset,
> -		u8 *Value);
>   bool
>   Efuse_Read1ByteFromFakeContent(
>   			struct adapter *pAdapter,
> 

Phil,

There a number of such forward references immediately followed by the actual 
routine. I removed some of these when the driver was in the GitHub repo, but I 
missed a few.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Larry


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent
  2021-08-21 14:45 ` Larry Finger
@ 2021-08-21 17:10   ` Phillip Potter
  0 siblings, 0 replies; 7+ messages in thread
From: Phillip Potter @ 2021-08-21 17:10 UTC (permalink / raw)
  To: Larry Finger
  Cc: Greg KH, linux-staging, Linux Kernel Mailing List, Martin Kaiser,
	Michael Straube

On Sat, 21 Aug 2021 at 15:45, Larry Finger <Larry.Finger@lwfinger.net> wrote:
>
> On 8/20/21 7:05 PM, Phillip Potter wrote:
> > Remove forward declaration of Efuse_Read1ByteFromFakeContent function
> > from core/rtw_efuse.c, as the function is defined in full directly
> > after this and therefore this forward declaration is redundant.
> >
> > Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
> > ---
> >   drivers/staging/r8188eu/core/rtw_efuse.c | 6 ------
> >   1 file changed, 6 deletions(-)
> >
> > diff --git a/drivers/staging/r8188eu/core/rtw_efuse.c b/drivers/staging/r8188eu/core/rtw_efuse.c
> > index decccf7622f0..45b757ab64e1 100644
> > --- a/drivers/staging/r8188eu/core/rtw_efuse.c
> > +++ b/drivers/staging/r8188eu/core/rtw_efuse.c
> > @@ -29,12 +29,6 @@ u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN] = {0};
> >   #define REG_EFUSE_CTRL              0x0030
> >   #define EFUSE_CTRL                  REG_EFUSE_CTRL          /*  E-Fuse Control. */
> >   /*  */
> > -
> > -bool
> > -Efuse_Read1ByteFromFakeContent(
> > -                     struct adapter *pAdapter,
> > -                     u16 Offset,
> > -             u8 *Value);
> >   bool
> >   Efuse_Read1ByteFromFakeContent(
> >                       struct adapter *pAdapter,
> >
>
> Phil,
>
> There a number of such forward references immediately followed by the actual
> routine. I removed some of these when the driver was in the GitHub repo, but I
> missed a few.
>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
>
> Larry
>

Dear Larry,

Thanks for this, I ended up doing a V2 that declares the function as
static as well. No doubt there will be others like this - I just
picked this one off as I happened to notice it :-)

Regards,
Phil

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-21 17:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-21  0:05 [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent Phillip Potter
2021-08-21  3:10 ` kernel test robot
2021-08-21  3:17 ` Fabio M. De Francesco
2021-08-21  8:30   ` Michael Straube
2021-08-21 10:42     ` Phillip Potter
2021-08-21 14:45 ` Larry Finger
2021-08-21 17:10   ` Phillip Potter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).