[OPW,kernel] Staging: vt6656: Fix Sparse Warning for Static Declarations in dpc.c
diff mbox

Message ID 1382648424-23743-1-git-send-email-ebru.akagunduz@gmail.com
State Changes Requested
Headers show

Commit Message

Ebru Akagündüz Oct. 24, 2013, 9 p.m. UTC
This patch fixes the Sparse Warning "symbol was
not declared. Should it be static?" in dpc.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
---
 drivers/staging/vt6656/dpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rusty Russell Oct. 25, 2013, 1:10 a.m. UTC | #1
Ebru Akagunduz <ebru.akagunduz@gmail.com> writes:
> This patch fixes the Sparse Warning "symbol was
> not declared. Should it be static?" in dpc.c
>
> Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>

But that's not all it does...

> ---
>  drivers/staging/vt6656/dpc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
> index 75dc92d..16ffe89 100644
> --- a/drivers/staging/vt6656/dpc.c
> +++ b/drivers/staging/vt6656/dpc.c
> @@ -59,7 +59,7 @@
>  //static int          msglevel                =MSG_LEVEL_DEBUG;
>  static int          msglevel                =MSG_LEVEL_INFO;
>  
> -const u8 acbyRxRate[MAX_RATE] =
> +static const u8 acbyRxRate[MAX_RATE] =
>  {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108};
>  
>  static u8 s_byGetRateIdx(u8 byRate);
> @@ -246,7 +246,7 @@ s_vGetDASA (
>      *pcbHeaderSize = cbHeaderSize;
>  }
>  
> -int RXbBulkInProcessData(struct vnt_private *pDevice, struct vnt_rcb *pRCB,
> +static int RXbBulkInProcessData(struct vnt_private *pDevice, struct vnt_rcb *pRCB,
>  	unsigned long BytesToIndicate)
>  {
>  	struct net_device_stats *pStats = &pDevice->stats;
> -- 

And this one is wrong.

Cheers,
Rusty.
Ebru Akagündüz Oct. 27, 2013, 11:03 p.m. UTC | #2
> > -int RXbBulkInProcessData(struct vnt_private *pDevice, struct vnt_rcb
> *pRCB,
> > +static int RXbBulkInProcessData(struct vnt_private *pDevice, struct
> vnt_rcb *pRCB,
> >       unsigned long BytesToIndicate)
> >  {
> >       struct net_device_stats *pStats = &pDevice->stats;
> > --
>
> And this one is wrong.
>
>
I couldn't understand. Why this patch is wrong? How should I fix it?

Thanks.
Rusty Russell Oct. 28, 2013, 3:20 a.m. UTC | #3
Ebru Akagunduz <ebru.akagunduz@gmail.com> writes:

>> > -int RXbBulkInProcessData(struct vnt_private *pDevice, struct vnt_rcb
>> *pRCB,
>> > +static int RXbBulkInProcessData(struct vnt_private *pDevice, struct
>> vnt_rcb *pRCB,
>> >       unsigned long BytesToIndicate)
>> >  {
>> >       struct net_device_stats *pStats = &pDevice->stats;
>> > --
>>
>> And this one is wrong.
>>
>>
> I couldn't understand. Why this patch is wrong? How should I fix it?

In my tree, RXbBulkInProcessData is called in
staging/drivers/staging/vt6656/usbpipe.c.

So you can't make it static...

Cheers,
Rusty.
Greg KH Oct. 28, 2013, 3:20 a.m. UTC | #4
On Mon, Oct 28, 2013 at 01:03:55AM +0200, Ebru Akagunduz wrote:
> 
>     > -int RXbBulkInProcessData(struct vnt_private *pDevice, struct vnt_rcb
>     *pRCB,
>     > +static int RXbBulkInProcessData(struct vnt_private *pDevice, struct
>     vnt_rcb *pRCB,
>     >       unsigned long BytesToIndicate)
>     >  {
>     >       struct net_device_stats *pStats = &pDevice->stats;
>     > --
> 
>     And this one is wrong.
> 
> 
> 
> I couldn't understand. Why this patch is wrong? How should I fix it?

Without all of the context, I can't remember anymore.

Remember, "kernel maintainer's brain == squirrel", we need context.

greg k-h

Patch
diff mbox

diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index 75dc92d..16ffe89 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -59,7 +59,7 @@ 
 //static int          msglevel                =MSG_LEVEL_DEBUG;
 static int          msglevel                =MSG_LEVEL_INFO;
 
-const u8 acbyRxRate[MAX_RATE] =
+static const u8 acbyRxRate[MAX_RATE] =
 {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108};
 
 static u8 s_byGetRateIdx(u8 byRate);
@@ -246,7 +246,7 @@  s_vGetDASA (
     *pcbHeaderSize = cbHeaderSize;
 }
 
-int RXbBulkInProcessData(struct vnt_private *pDevice, struct vnt_rcb *pRCB,
+static int RXbBulkInProcessData(struct vnt_private *pDevice, struct vnt_rcb *pRCB,
 	unsigned long BytesToIndicate)
 {
 	struct net_device_stats *pStats = &pDevice->stats;