diff mbox

[OPW,kernel] static:keucr: Fix sparse warning of static declarations

Message ID 20140314105800.GA5560@himangi-Inspiron-N5110gmail.com
State New, archived
Headers show

Commit Message

HIMANGI SARAOGI March 14, 2014, 10:58 a.m. UTC
This patch fixes the warning:
drivers/staging/keucr/smilsub.c:603:6: warning: symbol '_Check_D_DevCode' was not declared. Should it be static?
by making function static as it is used within the file.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
 drivers/staging/keucr/smilsub.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pablo Neira Ayuso March 14, 2014, 11:05 a.m. UTC | #1
On Fri, Mar 14, 2014 at 04:28:00PM +0530, Himangi Saraogi wrote:
> This patch fixes the warning:
> drivers/staging/keucr/smilsub.c:603:6: warning: symbol '_Check_D_DevCode' was not declared. Should it be static?
> by making function static as it is used within the file.

Looks good to me:

Acked-by: Pablo Neira Ayuso <pablo@gnumonks.org>

Could you send a follow up patch to remove that horrible BYTE and
similar types?

From common.h:

typedef u8 BOOLEAN;  <-- You can use "bool" instead.
typedef u8 BYTE;     <-- You can use "u8"
typedef u8 *PBYTE;   <-- u8 *
typedef u16 WORD;    <-- u16
typedef u16 *PWORD;  <-- u16 *
typedef u32 DWORD;   <-- u32
typedef u32 *PDWORD; <-- u32 *

Perhaps I'm wrong, but I think this can be done using coccinelle,
Julia?
Sarah Sharp March 14, 2014, 7:17 p.m. UTC | #2
On Fri, Mar 14, 2014 at 12:05:14PM +0100, Pablo Neira Ayuso wrote:
> On Fri, Mar 14, 2014 at 04:28:00PM +0530, Himangi Saraogi wrote:
> > This patch fixes the warning:
> > drivers/staging/keucr/smilsub.c:603:6: warning: symbol '_Check_D_DevCode' was not declared. Should it be static?
> > by making function static as it is used within the file.
> 
> Looks good to me:
> 
> Acked-by: Pablo Neira Ayuso <pablo@gnumonks.org>

Himangi, did you mean to have the subject be

staging: keucr: Fix sparse warning of static

instead of

static:keucr: Fix sparse warning of static

You may want to resend, although it's not a big deal.

Sarah Sharp

> 
> Could you send a follow up patch to remove that horrible BYTE and
> similar types?
> 
> From common.h:
> 
> typedef u8 BOOLEAN;  <-- You can use "bool" instead.
> typedef u8 BYTE;     <-- You can use "u8"
> typedef u8 *PBYTE;   <-- u8 *
> typedef u16 WORD;    <-- u16
> typedef u16 *PWORD;  <-- u16 *
> typedef u32 DWORD;   <-- u32
> typedef u32 *PDWORD; <-- u32 *
> 
> Perhaps I'm wrong, but I think this can be done using coccinelle,
> Julia?
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Waskiewicz Jr, Peter P March 17, 2014, 1:43 a.m. UTC | #3
On Fri, 2014-03-14 at 16:28 +0530, Himangi Saraogi wrote:
> This patch fixes the warning:
> drivers/staging/keucr/smilsub.c:603:6: warning: symbol '_Check_D_DevCode' was not declared. Should it be static?
> by making function static as it is used within the file.
> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>

Applied, thanks.

I also fixed the subject line per Sarah's comment.

> ---
>  drivers/staging/keucr/smilsub.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/keucr/smilsub.c b/drivers/staging/keucr/smilsub.c
> index 16da9a9..2e7e137 100644
> --- a/drivers/staging/keucr/smilsub.c
> +++ b/drivers/staging/keucr/smilsub.c
> @@ -600,7 +600,7 @@ int Set_D_SsfdcModel(BYTE dcode)
>  }
>  
>  /* ----- _Check_D_DevCode() --------------------------------------------- */
> -BYTE _Check_D_DevCode(BYTE dcode)
> +static BYTE _Check_D_DevCode(BYTE dcode)
>  {
>  	switch (dcode) {
>  	case 0x6E:
> -- 
> 1.7.9.5
>
diff mbox

Patch

diff --git a/drivers/staging/keucr/smilsub.c b/drivers/staging/keucr/smilsub.c
index 16da9a9..2e7e137 100644
--- a/drivers/staging/keucr/smilsub.c
+++ b/drivers/staging/keucr/smilsub.c
@@ -600,7 +600,7 @@  int Set_D_SsfdcModel(BYTE dcode)
 }
 
 /* ----- _Check_D_DevCode() --------------------------------------------- */
-BYTE _Check_D_DevCode(BYTE dcode)
+static BYTE _Check_D_DevCode(BYTE dcode)
 {
 	switch (dcode) {
 	case 0x6E: