All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] staging: rtl8723au: Fix static symbol sparse warning
  2014-08-01 13:06 [PATCH] staging: rtl8723au: Fix static symbol sparse warning Miguel Oliveira
@ 2014-08-01 12:11 ` Paul Bolle
  2014-08-01 14:46 ` Larry Finger
  1 sibling, 0 replies; 5+ messages in thread
From: Paul Bolle @ 2014-08-01 12:11 UTC (permalink / raw)
  To: Miguel Oliveira
  Cc: Larry.Finger, Jes.Sorensen, gregkh, linux-wireless, devel, linux-kernel

On Fri, 2014-08-01 at 14:06 +0100, Miguel Oliveira wrote:
> Fix sparse warning:
> drivers/staging/rtl8723au/core/rtw_efuse.c:579:5: warning: symbol 'efuse_GetCurrentSize23a' was not declared. Should it be static?
> 
> Signed-off-by: Miguel Oliveira <cmroliv@gmail.com>
> ---
>  drivers/staging/rtl8723au/include/rtw_efuse.h |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/rtl8723au/include/rtw_efuse.h b/drivers/staging/rtl8723au/include/rtw_efuse.h
> index 07bdc34..304cc71 100644
> --- a/drivers/staging/rtl8723au/include/rtw_efuse.h
> +++ b/drivers/staging/rtl8723au/include/rtw_efuse.h
> @@ -82,6 +82,7 @@ struct pg_pkt_struct {
>  /*------------------------Export global variable----------------------------*/
>  
>  u16	efuse_GetMaxSize23a(struct rtw_adapter *padapter);
> +int	efuse_GetCurrentSize23a(struct rtw_adapter *padapter, u16 *size);
>  int	rtw_efuse_access23a(struct rtw_adapter *padapter, u8 bRead, u16 start_addr, u16 cnts, u8 *data);
>  int	rtw_efuse_map_read23a(struct rtw_adapter *padapter, u16 addr, u16 cnts, u8 *data);
>  u8	rtw_efuse_map_write(struct rtw_adapter *padapter, u16 addr, u16 cnts, u8 *data);

This function is never used in current linux-next. So I think it might
as well be dropped.

Note there's also Efuse_GetCurrentSize23a (with an uppercase 'E'). It's
used just once. You could probably submit another patch to remove that
from rtw_efuse.h and make it static in rtw_efuse.c The comment above
that function needs and update too, but maybe it's also OK to drop that
comment.


Paul Bolle


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

* [PATCH] staging: rtl8723au: Fix static symbol sparse warning
@ 2014-08-01 13:06 Miguel Oliveira
  2014-08-01 12:11 ` Paul Bolle
  2014-08-01 14:46 ` Larry Finger
  0 siblings, 2 replies; 5+ messages in thread
From: Miguel Oliveira @ 2014-08-01 13:06 UTC (permalink / raw)
  To: Larry.Finger, Jes.Sorensen, gregkh, linux-wireless, devel,
	linux-kernel, cmroliv

Fix sparse warning:
drivers/staging/rtl8723au/core/rtw_efuse.c:579:5: warning: symbol 'efuse_GetCurrentSize23a' was not declared. Should it be static?

Signed-off-by: Miguel Oliveira <cmroliv@gmail.com>
---
 drivers/staging/rtl8723au/include/rtw_efuse.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8723au/include/rtw_efuse.h b/drivers/staging/rtl8723au/include/rtw_efuse.h
index 07bdc34..304cc71 100644
--- a/drivers/staging/rtl8723au/include/rtw_efuse.h
+++ b/drivers/staging/rtl8723au/include/rtw_efuse.h
@@ -82,6 +82,7 @@ struct pg_pkt_struct {
 /*------------------------Export global variable----------------------------*/
 
 u16	efuse_GetMaxSize23a(struct rtw_adapter *padapter);
+int	efuse_GetCurrentSize23a(struct rtw_adapter *padapter, u16 *size);
 int	rtw_efuse_access23a(struct rtw_adapter *padapter, u8 bRead, u16 start_addr, u16 cnts, u8 *data);
 int	rtw_efuse_map_read23a(struct rtw_adapter *padapter, u16 addr, u16 cnts, u8 *data);
 u8	rtw_efuse_map_write(struct rtw_adapter *padapter, u16 addr, u16 cnts, u8 *data);
-- 
1.7.10.4


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

* Re: [PATCH] staging: rtl8723au: Fix static symbol sparse warning
  2014-08-01 13:06 [PATCH] staging: rtl8723au: Fix static symbol sparse warning Miguel Oliveira
  2014-08-01 12:11 ` Paul Bolle
@ 2014-08-01 14:46 ` Larry Finger
  2014-08-01 16:54   ` Miguel Oliveira
  2014-08-02  9:55   ` Jes Sorensen
  1 sibling, 2 replies; 5+ messages in thread
From: Larry Finger @ 2014-08-01 14:46 UTC (permalink / raw)
  To: Miguel Oliveira, Jes.Sorensen, gregkh, linux-wireless, devel,
	linux-kernel

On 08/01/2014 08:06 AM, Miguel Oliveira wrote:
> Fix sparse warning:
> drivers/staging/rtl8723au/core/rtw_efuse.c:579:5: warning: symbol 'efuse_GetCurrentSize23a' was not declared. Should it be static?
> 
> Signed-off-by: Miguel Oliveira <cmroliv@gmail.com>
> ---
>  drivers/staging/rtl8723au/include/rtw_efuse.h |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/rtl8723au/include/rtw_efuse.h b/drivers/staging/rtl8723au/include/rtw_efuse.h
> index 07bdc34..304cc71 100644
> --- a/drivers/staging/rtl8723au/include/rtw_efuse.h
> +++ b/drivers/staging/rtl8723au/include/rtw_efuse.h
> @@ -82,6 +82,7 @@ struct pg_pkt_struct {
>  /*------------------------Export global variable----------------------------*/
>  
>  u16	efuse_GetMaxSize23a(struct rtw_adapter *padapter);
> +int	efuse_GetCurrentSize23a(struct rtw_adapter *padapter, u16 *size);
>  int	rtw_efuse_access23a(struct rtw_adapter *padapter, u8 bRead, u16 start_addr, u16 cnts, u8 *data);
>  int	rtw_efuse_map_read23a(struct rtw_adapter *padapter, u16 addr, u16 cnts, u8 *data);
>  u8	rtw_efuse_map_write(struct rtw_adapter *padapter, u16 addr, u16 cnts, u8 *data);

NACK. Whenever Sparse issues this warning, you should first check to see if it
can be made static. Adding it to a header to make the Sparse warning go away is
not correct unless some other routine needs it to be globally known. In this
case, no other routine needs it.

Of course, making it static will lead to the compilation warning that the
routine is not used. The correct patch is to delete the entire routine as it is
never called.

Larry



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

* [PATCH] staging: rtl8723au: Fix static symbol sparse warning
  2014-08-01 14:46 ` Larry Finger
@ 2014-08-01 16:54   ` Miguel Oliveira
  2014-08-02  9:55   ` Jes Sorensen
  1 sibling, 0 replies; 5+ messages in thread
From: Miguel Oliveira @ 2014-08-01 16:54 UTC (permalink / raw)
  To: Larry.Finger, Jes.Sorensen, gregkh, linux-wireless, devel,
	linux-kernel, cmroliv

Fix sparse warning:
drivers/staging/rtl8723au/core/rtw_efuse.c:579:5: warning: symbol 'efuse_GetCurrentSize23a' was not declared. Should it be static?
by removing efuse_GetCurrentSize23a since its never used

Signed-off-by: Miguel Oliveira <cmroliv@gmail.com>
---
 drivers/staging/rtl8723au/core/rtw_efuse.c |   25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_efuse.c b/drivers/staging/rtl8723au/core/rtw_efuse.c
index 345bff8..fe092c5 100644
--- a/drivers/staging/rtl8723au/core/rtw_efuse.c
+++ b/drivers/staging/rtl8723au/core/rtw_efuse.c
@@ -100,22 +100,6 @@ static void Efuse_PowerSwitch(struct rtw_adapter *padapter,
 	}
 }
 
-/*-----------------------------------------------------------------------------
- * Function:	efuse_GetCurrentSize23a
- *
- * Overview:	Get current efuse size!!!
- *
- * Input:       NONE
- *
- * Output:      NONE
- *
- * Return:      NONE
- *
- * Revised History:
- * When			Who		Remark
- * 11/16/2008	MHC		Create Version 0.
- *
- *---------------------------------------------------------------------------*/
 u16
 Efuse_GetCurrentSize23a(struct rtw_adapter *pAdapter, u8 efuseType)
 {
@@ -576,15 +560,6 @@ u16 efuse_GetMaxSize23a(struct rtw_adapter *padapter)
 	return max_size;
 }
 /*  */
-int efuse_GetCurrentSize23a(struct rtw_adapter *padapter, u16 *size)
-{
-	Efuse_PowerSwitch(padapter, false, true);
-	*size = Efuse_GetCurrentSize23a(padapter, EFUSE_WIFI);
-	Efuse_PowerSwitch(padapter, false, false);
-
-	return _SUCCESS;
-}
-/*  */
 int rtw_efuse_map_read23a(struct rtw_adapter *padapter,
 			  u16 addr, u16 cnts, u8 *data)
 {
-- 
1.7.10.4


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

* Re: [PATCH] staging: rtl8723au: Fix static symbol sparse warning
  2014-08-01 14:46 ` Larry Finger
  2014-08-01 16:54   ` Miguel Oliveira
@ 2014-08-02  9:55   ` Jes Sorensen
  1 sibling, 0 replies; 5+ messages in thread
From: Jes Sorensen @ 2014-08-02  9:55 UTC (permalink / raw)
  To: Larry Finger; +Cc: Miguel Oliveira, gregkh, linux-wireless, devel, linux-kernel

Larry Finger <Larry.Finger@lwfinger.net> writes:
> On 08/01/2014 08:06 AM, Miguel Oliveira wrote:
>> Fix sparse warning:
>> drivers/staging/rtl8723au/core/rtw_efuse.c:579:5: warning: symbol
>> efuse_GetCurrentSize23a' was not declared. Should it be static?
>> 
>> Signed-off-by: Miguel Oliveira <cmroliv@gmail.com>
>> ---
>>  drivers/staging/rtl8723au/include/rtw_efuse.h |    1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/drivers/staging/rtl8723au/include/rtw_efuse.h
>> b/drivers/staging/rtl8723au/include/rtw_efuse.h
>> index 07bdc34..304cc71 100644
>> --- a/drivers/staging/rtl8723au/include/rtw_efuse.h
>> +++ b/drivers/staging/rtl8723au/include/rtw_efuse.h
>> @@ -82,6 +82,7 @@ struct pg_pkt_struct {
>>  /*------------------------Export global
>> variable----------------------------*/
>>  
>>  u16	efuse_GetMaxSize23a(struct rtw_adapter *padapter);
>> +int	efuse_GetCurrentSize23a(struct rtw_adapter *padapter, u16 *size);
>>  int rtw_efuse_access23a(struct rtw_adapter *padapter, u8 bRead, u16
>> start_addr, u16 cnts, u8 *data);
>>  int rtw_efuse_map_read23a(struct rtw_adapter *padapter, u16 addr,
>> u16 cnts, u8 *data);
>>  u8 rtw_efuse_map_write(struct rtw_adapter *padapter, u16 addr, u16
>> cnts, u8 *data);
>
> NACK. Whenever Sparse issues this warning, you should first check to see if it
> can be made static. Adding it to a header to make the Sparse warning go away is
> not correct unless some other routine needs it to be globally known. In this
> case, no other routine needs it.
>
> Of course, making it static will lead to the compilation warning that the
> routine is not used. The correct patch is to delete the entire routine as it is
> never called.

Yep, fix it correctly, or don't bother!

Cheers,
Jes

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

end of thread, other threads:[~2014-08-02  9:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-01 13:06 [PATCH] staging: rtl8723au: Fix static symbol sparse warning Miguel Oliveira
2014-08-01 12:11 ` Paul Bolle
2014-08-01 14:46 ` Larry Finger
2014-08-01 16:54   ` Miguel Oliveira
2014-08-02  9:55   ` Jes Sorensen

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.