2021-08-21 00:09:48

by Phillip Potter

[permalink] [raw]
Subject: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent

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


2021-08-21 03:12:02

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent

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

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/[email protected]


Attachments:
(No filename) (3.39 kB)
.config.gz (53.74 kB)
Download all attachments

2021-08-21 03:19:00

by Fabio M. De Francesco

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent

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


2021-08-21 08:33:41

by Michael Straube

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent



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

2021-08-21 10:45:16

by Phillip Potter

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent

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

2021-08-21 14:47:17

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent

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

Larry

2021-08-21 17:11:52

by Phillip Potter

[permalink] [raw]
Subject: Re: [PATCH] staging: r8188eu: remove forward declaration of Efuse_Read1ByteFromFakeContent

On Sat, 21 Aug 2021 at 15:45, Larry Finger <[email protected]> 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 <[email protected]>
> > ---
> > 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 <[email protected]>
>
> 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