[OPW,kernel] staging: rts5139: Fix Sparse Warning for Static Declarations in sd_cprm.c
diff mbox

Message ID 1381941399-3476-1-git-send-email-archanakumari959@gmail.com
State Rejected
Headers show

Commit Message

Archana kumari Oct. 16, 2013, 4:36 p.m. UTC
This patch fixes the Sparse Warnings for static declaration in sd_cprm.c:

Signed-off-by: Archana kumari <archanakumari959@gmail.com>
---
 drivers/staging/rts5139/sd_cprm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Greg Kroah-Hartman Oct. 16, 2013, 4:53 p.m. UTC | #1
On Wed, Oct 16, 2013 at 10:06:39PM +0530, Archana kumari wrote:
> This patch fixes the Sparse Warnings for static declaration in sd_cprm.c:

What's with the ':' at the end of this line and the odd capitalization
of this sentence (and the Subject:)?

Most grammar rules apply to kernel changelog entries and subject: lines
wherever possible.

> Signed-off-by: Archana kumari <archanakumari959@gmail.com>

Nice, but unfortunately this patch breaks the build in horrible ways,
meaning that you never even tested that it built properly :(

Please, _ALWAYS_ test build your patches, you should never make a kernel
maintainer find this out themselves, it makes them grumpy, and dread
future patches from the patch author...

If you have problems test building your patches, please let us know and
we will be glad to help you out.  The fact that you ran sparse on the
code means that you were able to build this one time, but then after
making the change, what happened to keep you from test building it
again?

thanks,

greg k-h
Archana kumari Oct. 16, 2013, 5:13 p.m. UTC | #2
I am very confused , Greg
I compiled the driver even after making the changes and 
it had build properly , I have no clue why  it is breaking the build 
now. please help me out.

thanks
Archana
Greg Kroah-Hartman Oct. 16, 2013, 5:16 p.m. UTC | #3
On Wed, Oct 16, 2013 at 10:13:06AM -0700, Archana Kumari wrote:
> 
> I am very confused , Greg
> I compiled the driver even after making the changes and
> it had build properly , I have no clue why  it is breaking the build
> now. please help me out.

What exactly did you type, and what did it display on the screen when
you built it?

greg k-h
Archana kumari Oct. 16, 2013, 5:21 p.m. UTC | #4
I typed 

>  make C=2 drivers/staging/rts5139/
>
and it compiled well with the warning deleted from the file sd_cprm.c

thanks
Archana
Greg Kroah-Hartman Oct. 16, 2013, 5:33 p.m. UTC | #5
On Wed, Oct 16, 2013 at 10:21:34AM -0700, Archana Kumari wrote:
> 
> I typed
> 
>      make C=2 drivers/staging/rts5139/
> 
> and it compiled well with the warning deleted from the file sd_cprm.c

Please send the full output of what it produced.  No need for the "C=2"
line, that's not the issue here.

greg k-h
Archana kumari Oct. 16, 2013, 5:57 p.m. UTC | #6
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `relocs'.
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHECK   scripts/mod/empty.c
  CHECK   drivers/staging/rts5139/rts51x_transport.c
/home/archana/linux/arch/x86/include/asm/jump_label.h:21:9: error: bad asm 
output
/home/archana/linux/arch/x86/include/asm/jump_label.h:21:9: error: bad asm 
output
  CHECK   drivers/staging/rts5139/rts51x_scsi.c
drivers/staging/rts5139/rts51x_scsi.c:444:15: warning: symbol 
'formatter_inquiry_str' was not declared. Should it be static?
drivers/staging/rts5139/rts51x_scsi.c:1994:5: warning: symbol 
'queuecommand_lck' was not declared. Should it be static?
/home/archana/linux/arch/x86/include/asm/jump_label.h:21:9: error: bad asm 
output
/home/archana/linux/arch/x86/include/asm/jump_label.h:21:9: error: bad asm 
output
  CHECK   drivers/staging/rts5139/rts51x_fop.c
drivers/staging/rts5139/rts51x_fop.c:96:35: warning: incorrect type in 
argument 1 (different address spaces)
drivers/staging/rts5139/rts51x_fop.c:96:35:    expected void [noderef] 
<asn:1>*dst
drivers/staging/rts5139/rts51x_fop.c:96:35:    got void *<noident>
drivers/staging/rts5139/rts51x_fop.c:112:50: warning: incorrect type in 
argument 2 (different address spaces)
drivers/staging/rts5139/rts51x_fop.c:112:50:    expected void const 
[noderef] <asn:1>*from
drivers/staging/rts5139/rts51x_fop.c:112:50:    got void *<noident>
drivers/staging/rts5139/rts51x_fop.c:157:32: warning: incorrect type in 
argument 1 (different address spaces)
drivers/staging/rts5139/rts51x_fop.c:157:32:    expected void [noderef] 
<asn:1>*dst
drivers/staging/rts5139/rts51x_fop.c:157:32:    got void *<noident>
drivers/staging/rts5139/rts51x_fop.c:253:52: warning: incorrect type in 
argument 2 (different address spaces)
drivers/staging/rts5139/rts51x_fop.c:253:52:    expected void const 
[noderef] <asn:1>*from
drivers/staging/rts5139/rts51x_fop.c:253:52:    got void *<noident>
drivers/staging/rts5139/rts51x_fop.c:268:51: warning: incorrect type in 
argument 2 (different address spaces)
drivers/staging/rts5139/rts51x_fop.c:268:51:    expected void const 
[noderef] <asn:1>*from
drivers/staging/rts5139/rts51x_fop.c:268:51:    got void *<noident>
  CHECK   drivers/staging/rts5139/rts51x.c
drivers/staging/rts5139/rts51x.c:219:5: warning: symbol 'rts51x_pre_reset' 
was not declared. Should it be static?
drivers/staging/rts5139/rts51x.c:230:5: warning: symbol 'rts51x_post_reset' 
was not declared. Should it be static?
/home/archana/linux/arch/x86/include/asm/jump_label.h:21:9: error: bad asm 
output
/home/archana/linux/arch/x86/include/asm/jump_label.h:21:9: error: bad asm 
output
/home/archana/linux/arch/x86/include/asm/jump_label.h:21:9: error: bad asm 
output
/home/archana/linux/arch/x86/include/asm/jump_label.h:21:9: error: bad asm 
output
  CHECK   drivers/staging/rts5139/rts51x_chip.c
  CHECK   drivers/staging/rts5139/rts51x_card.c
  CHECK   drivers/staging/rts5139/xd.c
  CHECK   drivers/staging/rts5139/sd.c
  CHECK   drivers/staging/rts5139/ms.c
  CHECK   drivers/staging/rts5139/sd_cprm.c
drivers/staging/rts5139/sd_cprm.c:272:5: warning: symbol 
'ext_rts51x_sd_execute_no_data' was not declared. Should it be static?
drivers/staging/rts5139/sd_cprm.c:340:5: warning: symbol 
'ext_rts51x_sd_execute_read_data' was not declared. Should it be static?
drivers/staging/rts5139/sd_cprm.c:545:5: warning: symbol 
'ext_rts51x_sd_execute_write_data' was not declared. Should it be static?
drivers/staging/rts5139/sd_cprm.c:781:5: warning: symbol 
'rts51x_sd_pass_thru_mode' was not declared. Should it be static?
drivers/staging/rts5139/sd_cprm.c:853:5: warning: symbol 
'rts51x_sd_execute_no_data' was not declared. Should it be static?
drivers/staging/rts5139/sd_cprm.c:885:5: warning: symbol 
'rts51x_sd_execute_read_data' was not declared. Should it be static?
drivers/staging/rts5139/sd_cprm.c:923:5: warning: symbol 
'rts51x_sd_execute_write_data' was not declared. Should it be static?
drivers/staging/rts5139/sd_cprm.c:961:5: warning: symbol 
'rts51x_sd_get_cmd_rsp' was not declared. Should it be static?
drivers/staging/rts5139/sd_cprm.c:1000:5: warning: symbol 
'rts51x_sd_hw_rst' was not declared. Should it be static?
  CC [M]  drivers/staging/rts5139/sd_cprm.o
  CHECK   drivers/staging/rts5139/ms_mg.c
drivers/staging/rts5139/ms_mg.c:81:5: warning: symbol 'mg_set_tpc_para_sub' 
was not declared. Should it be static?
drivers/staging/rts5139/ms_mg.c:122:5: warning: symbol 
'rts51x_mg_set_leaf_id' was not declared. Should it be static?
drivers/staging/rts5139/ms_mg.c:173:5: warning: symbol 
'rts51x_mg_get_local_EKB' was not declared. Should it be static?
drivers/staging/rts5139/ms_mg.c:232:5: warning: symbol 'rts51x_mg_chg' was 
not declared. Should it be static?
drivers/staging/rts5139/ms_mg.c:323:5: warning: symbol 
'rts51x_mg_get_rsp_chg' was not declared. Should it be static?
drivers/staging/rts5139/ms_mg.c:392:5: warning: symbol 'rts51x_mg_rsp' was 
not declared. Should it be static?
drivers/staging/rts5139/ms_mg.c:450:5: warning: symbol 'rts51x_mg_get_ICV' 
was not declared. Should it be static?
drivers/staging/rts5139/ms_mg.c:514:5: warning: symbol 'rts51x_mg_set_ICV' 
was not declared. Should it be static?
  LD [M]  drivers/staging/rts5139/rts5139.o
Greg Kroah-Hartman Oct. 16, 2013, 6:08 p.m. UTC | #7
On Wed, Oct 16, 2013 at 10:57:46AM -0700, Archana Kumari wrote:
> 

Please stop sending HTML email, almost all Linux kernel mailing lists
will just delete emails send with HTML in them.

And also, please at least give us some context as to what is going on
here.  Some of us receive about 1000 emails a day, without some context,
we don't know what is going on at all, nor what should be done with this
email.

> 
>  make[1]: Nothing to be done for `all'.
> make[1]: Nothing to be done for `relocs'.
>   CHK     include/config/kernel.release
>   CHK     include/generated/uapi/linux/version.h
>   CHK     include/generated/utsrelease.h
>   CALL    scripts/checksyscalls.sh
>   CHECK   scripts/mod/empty.c
>   CHECK   drivers/staging/rts5139/rts51x_transport.c

I asked to provide the output without "C=2" please.

Also show what you typed to create this output.

thanks,

greg k-h
Archana kumari Oct. 16, 2013, 6:22 p.m. UTC | #8
sorry for the inconvinence greg;

 when i typed in make drivers/staging/rts5139/
it gave the following output

make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `relocs'.
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CC [M]  drivers/staging/rts5139/sd_cprm.o
  LD [M]  drivers/staging/rts5139/rts5139.o
Greg Kroah-Hartman Oct. 16, 2013, 6:29 p.m. UTC | #9
On Wed, Oct 16, 2013 at 11:22:14AM -0700, Archana Kumari wrote:
> 
> 
>  sorry for the inconvinence greg;
> 
>  when i typed in make drivers/staging/rts5139/
> it gave the following output
> 
> make[1]: Nothing to be done for `all'.
> make[1]: Nothing to be done for `relocs'.
>   CHK     include/config/kernel.release
>   CHK     include/generated/uapi/linux/version.h
>   CHK     include/generated/utsrelease.h
>   CALL    scripts/checksyscalls.sh
>   CC [M]  drivers/staging/rts5139/sd_cprm.o
>   LD [M]  drivers/staging/rts5139/rts5139.o

What if you type:
	make M=drivers/staging/rts5139

Or better yet, just a simple:
	make

thanks,

greg k-h
Archana kumari Oct. 16, 2013, 6:36 p.m. UTC | #10
when I type 
make M=drivers/staging/rts5139
I get the output as

  WARNING: Symbol version dump /home/archana/linux/Module.symvers
           is missing; modules will have no dependencies and modversions.

  Building modules, stage 2.
  MODPOST 1 modules
  CC      drivers/staging/rts5139/rts5139.mod.o
  LD [M]  drivers/staging/rts5139/rts5139.ko
Archana kumari Oct. 16, 2013, 6:57 p.m. UTC | #11
and when I type a simple make I get rivers/staging/media/lirc/lirc_imon.c: 
In function ‘imon_probe’:
drivers/staging/media/lirc/lirc_imon.c:927:4: error: expected ‘)’ before 
‘__func__’
drivers/staging/media/lirc/lirc_imon.c:927:4: warning: format ‘%s’ expects 
a matching ‘char *’ argument [-Wformat]
make[4]: *** [drivers/staging/media/lirc/lirc_imon.o] Error 1
make[3]: *** [drivers/staging/media/lirc] Error 2
make[2]: *** [drivers/staging/media] Error 2
make[1]: *** [drivers/staging] Error 2
make: *** [drivers] Error 2
but I didnt modify this driver...
Greg Kroah-Hartman Oct. 16, 2013, 7:12 p.m. UTC | #12
On Wed, Oct 16, 2013 at 11:57:15AM -0700, Archana Kumari wrote:
> 
> 
> and when I type a simple make I get rivers/staging/media/lirc/lirc_imon.c: In
> function ‘imon_probe’:
> drivers/staging/media/lirc/lirc_imon.c:927:4: error: expected ‘)’ before
> ‘__func__’
> drivers/staging/media/lirc/lirc_imon.c:927:4: warning: format ‘%s’ expects a
> matching ‘char *’ argument [-Wformat]
> make[4]: *** [drivers/staging/media/lirc/lirc_imon.o] Error 1
> make[3]: *** [drivers/staging/media/lirc] Error 2
> make[2]: *** [drivers/staging/media] Error 2
> make[1]: *** [drivers/staging] Error 2
> make: *** [drivers] Error 2
> but I didnt modify this driver...

Resync with my tree, that driver is now fixed.

Or disable it in your .config file, either way should be fine.

greg k-h
Greg Kroah-Hartman Oct. 16, 2013, 7:13 p.m. UTC | #13
On Wed, Oct 16, 2013 at 11:36:12AM -0700, Archana Kumari wrote:
>  
>  when I type
> make M=drivers/staging/rts5139
> I get the output as
> 
>   WARNING: Symbol version dump /home/archana/linux/Module.symvers
>            is missing; modules will have no dependencies and modversions.
> 
>   Building modules, stage 2.
>   MODPOST 1 modules
>   CC      drivers/staging/rts5139/rts5139.mod.o
>   LD [M]  drivers/staging/rts5139/rts5139.ko

Odd, it should be failing, I guess the final link stage is what is
needed here, 'make' on its own will show you the error that happens with
your patch applied.

greg k-h
Archana kumari Oct. 16, 2013, 7:22 p.m. UTC | #14
greg I sent you the final link of my compilation 
  
 it said nothing apart from this.
 now please give me direction 
 what should I do?
Greg Kroah-Hartman Oct. 16, 2013, 7:30 p.m. UTC | #15
On Wed, Oct 16, 2013 at 12:22:56PM -0700, Archana Kumari wrote:
> 
> 
>   greg I sent you the final link of my compilation

Where?  When?  In this email?

>  it said nothing apart from this.

Apart from what?

>  now please give me direction
>  what should I do?

I have no idea, I'm confused as to what this is all about.

Remember, maintainers have a brain of a squirrel, we need context...

Try typing 'make' and see the error that happens when your patch is
applied.  You will note that other parts of the driver rely on the
functions you removed (you can grep the tree for where it is called,
that's a simple check to verify you really should be marking things as
static.)

thanks,

greg k-h
Archana kumari Oct. 17, 2013, 7:14 a.m. UTC | #16
hii
   
  I am badly stuck in this patch . It is breaking  the build when Greg 
tries to apply it on his staging tree 
  but I recieve the following messages when I test it on my system.

when I type make  make M=drivers/staging/rts5139/

the output is 

 WARNING: Symbol version dump /home/archana/linux/Module.symvers
           is missing; modules will have no dependencies and modversions.

  Building modules, stage 2.
  MODPOST 1 modules

now what shoud I do next to repair the build

anyone please help.

thanks
Archana
Greg Kroah-Hartman Oct. 17, 2013, 1:24 p.m. UTC | #17
On Thu, Oct 17, 2013 at 12:14:37AM -0700, Archana Kumari wrote:
> 
> 
> 
>    hii
>   
>   I am badly stuck in this patch .

What patch?

> It is breaking  the build when Greg tries to apply it on his staging
> tree but I recieve the following messages when I test it on my system.
> 
> when I type make  make M=drivers/staging/rts5139/
> 
> the output is
> 
>  WARNING: Symbol version dump /home/archana/linux/Module.symvers
>            is missing; modules will have no dependencies and modversions.

That's not a problem, nor is it what I saw.

> 
>   Building modules, stage 2.
>   MODPOST 1 modules
> 
> now what shoud I do next to repair the build

What happens if you just run 'make'?

Patch
diff mbox

diff --git a/drivers/staging/rts5139/sd_cprm.c b/drivers/staging/rts5139/sd_cprm.c
index d468983..aeee66b 100644
--- a/drivers/staging/rts5139/sd_cprm.c
+++ b/drivers/staging/rts5139/sd_cprm.c
@@ -269,7 +269,7 @@  static int ext_sd_get_rsp(struct rts51x_chip *chip, int len,
 	return STATUS_SUCCESS;
 }
 
-int ext_rts51x_sd_execute_no_data(struct rts51x_chip *chip, unsigned int lun,
+static int ext_rts51x_sd_execute_no_data(struct rts51x_chip *chip, unsigned int lun,
 			   u8 cmd_idx, u8 standby, u8 acmd, u8 rsp_code,
 			   u32 arg)
 {
@@ -337,7 +337,7 @@  SD_Execute_Cmd_Failed:
 	TRACE_RET(chip, TRANSPORT_FAILED);
 }
 
-int ext_rts51x_sd_execute_read_data(struct rts51x_chip *chip, unsigned int lun,
+static int ext_rts51x_sd_execute_read_data(struct rts51x_chip *chip, unsigned int lun,
 			     u8 cmd_idx, u8 cmd12, u8 standby,
 			     u8 acmd, u8 rsp_code, u32 arg, u32 data_len,
 			     void *data_buf, unsigned int buf_len, int use_sg)
@@ -542,7 +542,7 @@  SD_Execute_Read_Cmd_Failed:
 	TRACE_RET(chip, TRANSPORT_FAILED);
 }
 
-int ext_rts51x_sd_execute_write_data(struct rts51x_chip *chip, unsigned int lun,
+static int ext_rts51x_sd_execute_write_data(struct rts51x_chip *chip, unsigned int lun,
 			      u8 cmd_idx, u8 cmd12, u8 standby, u8 acmd,
 			      u8 rsp_code, u32 arg, u32 data_len,
 			      void *data_buf, unsigned int buf_len, int use_sg)