2011-03-26 16:16:34

by Ralf Thielow

[permalink] [raw]
Subject: [PATCH 1/4] staging: keucr: smscsi: Fixed most checkpatch warnings and errors.

This cleanup fixes most of the checkpatch warnings and errors.
Remaining warnings and errors are left untouched on purpose to
avoid making the code less readable. This cleanup also removes
some worthless comments.

Signed-off-by: Ralf Thielow <[email protected]>
---
drivers/staging/keucr/smscsi.c | 148 +++++++++++++++++++++-------------------
1 files changed, 79 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/keucr/smscsi.c b/drivers/staging/keucr/smscsi.c
index 6211686..c3db085 100644
--- a/drivers/staging/keucr/smscsi.c
+++ b/drivers/staging/keucr/smscsi.c
@@ -9,26 +9,24 @@
#include "usb.h"
#include "scsiglue.h"
#include "transport.h"
-//#include "smcommon.h"
#include "smil.h"

-int SM_SCSI_Test_Unit_Ready (struct us_data *us, struct scsi_cmnd *srb);
-int SM_SCSI_Inquiry (struct us_data *us, struct scsi_cmnd *srb);
-int SM_SCSI_Mode_Sense (struct us_data *us, struct scsi_cmnd *srb);
-int SM_SCSI_Start_Stop (struct us_data *us, struct scsi_cmnd *srb);
-int SM_SCSI_Read_Capacity (struct us_data *us, struct scsi_cmnd *srb);
-int SM_SCSI_Read (struct us_data *us, struct scsi_cmnd *srb);
-int SM_SCSI_Write (struct us_data *us, struct scsi_cmnd *srb);
+int SM_SCSI_Test_Unit_Ready(struct us_data *us, struct scsi_cmnd *srb);
+int SM_SCSI_Inquiry(struct us_data *us, struct scsi_cmnd *srb);
+int SM_SCSI_Mode_Sense(struct us_data *us, struct scsi_cmnd *srb);
+int SM_SCSI_Start_Stop(struct us_data *us, struct scsi_cmnd *srb);
+int SM_SCSI_Read_Capacity(struct us_data *us, struct scsi_cmnd *srb);
+int SM_SCSI_Read(struct us_data *us, struct scsi_cmnd *srb);
+int SM_SCSI_Write(struct us_data *us, struct scsi_cmnd *srb);

-extern struct SSFDCTYPE Ssfdc;
-extern struct ADDRESS Media;
-extern PBYTE SMHostAddr;
-extern DWORD ErrXDCode;
+extern struct SSFDCTYPE Ssfdc;
+extern struct ADDRESS Media;
+extern PBYTE SMHostAddr;
+extern DWORD ErrXDCode;

-//----- SM_SCSIIrp() --------------------------------------------------
int SM_SCSIIrp(struct us_data *us, struct scsi_cmnd *srb)
{
- int result;
+ int result;

us->SrbStatus = SS_SUCCESS;
switch (srb->cmnd[0])
@@ -48,99 +46,108 @@ int SM_SCSIIrp(struct us_data *us, struct scsi_cmnd *srb)
return result;
}

-//----- SM_SCSI_Test_Unit_Ready() --------------------------------------------------
int SM_SCSI_Test_Unit_Ready(struct us_data *us, struct scsi_cmnd *srb)
{
- //printk("SM_SCSI_Test_Unit_Ready\n");
- if (us->SM_Status.Insert && us->SM_Status.Ready)
+ /* printk("SM_SCSI_Test_Unit_Ready\n"); */
+ if (us->SM_Status.Insert && us->SM_Status.Ready) {
return USB_STOR_TRANSPORT_GOOD;
- else
- {
+ } else {
ENE_SMInit(us);
return USB_STOR_TRANSPORT_GOOD;
}
-
+
return USB_STOR_TRANSPORT_GOOD;
}

-//----- SM_SCSI_Inquiry() --------------------------------------------------
int SM_SCSI_Inquiry(struct us_data *us, struct scsi_cmnd *srb)
{
- //printk("SM_SCSI_Inquiry\n");
- BYTE data_ptr[36] = {0x00, 0x80, 0x02, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x55, 0x53, 0x42, 0x32, 0x2E, 0x30, 0x20, 0x20, 0x43, 0x61, 0x72, 0x64, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x31, 0x30, 0x30};
+ /* printk("SM_SCSI_Inquiry\n"); */
+ BYTE data_ptr[36] = {0x00, 0x80, 0x02, 0x00, 0x1F, 0x00,
+ 0x00, 0x00, 0x55, 0x53, 0x42, 0x32,
+ 0x2E, 0x30, 0x20, 0x20, 0x43, 0x61,
+ 0x72, 0x64, 0x52, 0x65, 0x61, 0x64,
+ 0x65, 0x72, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x30, 0x31, 0x30, 0x30};

usb_stor_set_xfer_buf(us, data_ptr, 36, srb, TO_XFER_BUF);
return USB_STOR_TRANSPORT_GOOD;
}


-//----- SM_SCSI_Mode_Sense() --------------------------------------------------
int SM_SCSI_Mode_Sense(struct us_data *us, struct scsi_cmnd *srb)
{
- BYTE mediaNoWP[12] = {0x0b,0x00,0x00,0x08,0x00,0x00,0x71,0xc0,0x00,0x00,0x02,0x00};
- BYTE mediaWP[12] = {0x0b,0x00,0x80,0x08,0x00,0x00,0x71,0xc0,0x00,0x00,0x02,0x00};
+ BYTE mediaNoWP[12] = {0x0b, 0x00, 0x00, 0x08, 0x00, 0x00,
+ 0x71, 0xc0, 0x00, 0x00, 0x02, 0x00};
+ BYTE mediaWP[12] = {0x0b, 0x00, 0x80, 0x08, 0x00, 0x00,
+ 0x71, 0xc0, 0x00, 0x00, 0x02, 0x00};

if (us->SM_Status.WtP)
usb_stor_set_xfer_buf(us, mediaWP, 12, srb, TO_XFER_BUF);
else
usb_stor_set_xfer_buf(us, mediaNoWP, 12, srb, TO_XFER_BUF);

-
return USB_STOR_TRANSPORT_GOOD;
}

-//----- SM_SCSI_Read_Capacity() --------------------------------------------------
int SM_SCSI_Read_Capacity(struct us_data *us, struct scsi_cmnd *srb)
{
unsigned int offset = 0;
struct scatterlist *sg = NULL;
- DWORD bl_num;
- WORD bl_len;
- BYTE buf[8];
+ DWORD bl_num;
+ WORD bl_len;
+ BYTE buf[8];

printk("SM_SCSI_Read_Capacity\n");

bl_len = 0x200;
bl_num = Ssfdc.MaxLogBlocks * Ssfdc.MaxSectors * Ssfdc.MaxZones - 1;
- //printk("MaxLogBlocks = %x\n", Ssfdc.MaxLogBlocks);
- //printk("MaxSectors = %x\n", Ssfdc.MaxSectors);
- //printk("MaxZones = %x\n", Ssfdc.MaxZones);
- //printk("bl_num = %x\n", bl_num);
+
+ /*
+ * printk("MaxLogBlocks = %x\n", Ssfdc.MaxLogBlocks);
+ * printk("MaxSectors = %x\n", Ssfdc.MaxSectors);
+ * printk("MaxZones = %x\n", Ssfdc.MaxZones);
+ * printk("bl_num = %x\n", bl_num);
+ */

us->bl_num = bl_num;
printk("bl_len = %x\n", bl_len);
printk("bl_num = %x\n", bl_num);

- //srb->request_bufflen = 8;
- buf[0] = (bl_num>>24) & 0xff;
- buf[1] = (bl_num>>16) & 0xff;
- buf[2] = (bl_num>> 8) & 0xff;
- buf[3] = (bl_num>> 0) & 0xff;
- buf[4] = (bl_len>>24) & 0xff;
- buf[5] = (bl_len>>16) & 0xff;
- buf[6] = (bl_len>> 8) & 0xff;
- buf[7] = (bl_len>> 0) & 0xff;
-
+ buf[0] = (bl_num >> 24) & 0xff;
+ buf[1] = (bl_num >> 16) & 0xff;
+ buf[2] = (bl_num >> 8) & 0xff;
+ buf[3] = (bl_num >> 0) & 0xff;
+ buf[4] = (bl_len >> 24) & 0xff;
+ buf[5] = (bl_len >> 16) & 0xff;
+ buf[6] = (bl_len >> 8) & 0xff;
+ buf[7] = (bl_len >> 0) & 0xff;
+
usb_stor_access_xfer_buf(us, buf, 8, srb, &sg, &offset, TO_XFER_BUF);
- //usb_stor_set_xfer_buf(us, buf, srb->request_bufflen, srb, TO_XFER_BUF);
+ /*
+ * usb_stor_set_xfer_buf(us, buf, srb->request_bufflen,
+ * srb, TO_XFER_BUF);
+ */

return USB_STOR_TRANSPORT_GOOD;
}

-//----- SM_SCSI_Read() --------------------------------------------------
int SM_SCSI_Read(struct us_data *us, struct scsi_cmnd *srb)
{
- //struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf;
- int result=0;
- PBYTE Cdb = srb->cmnd;
- DWORD bn = ((Cdb[2]<<24) & 0xff000000) | ((Cdb[3]<<16) & 0x00ff0000) |
- ((Cdb[4]<< 8) & 0x0000ff00) | ((Cdb[5]<< 0) & 0x000000ff);
- WORD blen = ((Cdb[7]<< 8) & 0xff00) | ((Cdb[8]<< 0) & 0x00ff);
- DWORD blenByte = blen * 0x200;
- void *buf;
-
- //printk("SCSIOP_READ --- bn = %X, blen = %X, srb->use_sg = %X\n", bn, blen, srb->use_sg);
-
+ /* struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; */
+ int result = 0;
+ PBYTE Cdb = srb->cmnd;
+ DWORD bn =
+ ((Cdb[2] << 24) & 0xff000000) | ((Cdb[3] << 16) & 0x00ff0000) |
+ ((Cdb[4] << 8) & 0x0000ff00) | ((Cdb[5] << 0) & 0x000000ff);
+ WORD blen = ((Cdb[7] << 8) & 0xff00) | ((Cdb[8] << 0) & 0x00ff);
+ DWORD blenByte = blen * 0x200;
+ void *buf;
+
+ /*
+ * printk("SCSIOP_READ --- bn = %X, blen = %X, srb->use_sg = %X\n",
+ * bn, blen, srb->use_sg);
+ */
+
if (bn > us->bl_num)
return USB_STOR_TRANSPORT_ERROR;

@@ -159,19 +166,22 @@ int SM_SCSI_Read(struct us_data *us, struct scsi_cmnd *srb)
return USB_STOR_TRANSPORT_GOOD;
}

-//----- SM_SCSI_Write() --------------------------------------------------
int SM_SCSI_Write(struct us_data *us, struct scsi_cmnd *srb)
{
- //struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf;
- int result=0;
- PBYTE Cdb = srb->cmnd;
- DWORD bn = ((Cdb[2]<<24) & 0xff000000) | ((Cdb[3]<<16) & 0x00ff0000) |
- ((Cdb[4]<< 8) & 0x0000ff00) | ((Cdb[5]<< 0) & 0x000000ff);
- WORD blen = ((Cdb[7]<< 8) & 0xff00) | ((Cdb[8]<< 0) & 0x00ff);
- DWORD blenByte = blen * 0x200;
- void *buf;
-
- //printk("SCSIOP_Write --- bn = %X, blen = %X, srb->use_sg = %X\n", bn, blen, srb->use_sg);
+ /* struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; */
+ int result = 0;
+ PBYTE Cdb = srb->cmnd;
+ DWORD bn =
+ ((Cdb[2] << 24) & 0xff000000) | ((Cdb[3] << 16) & 0x00ff0000) |
+ ((Cdb[4] << 8) & 0x0000ff00) | ((Cdb[5] << 0) & 0x000000ff);
+ WORD blen = ((Cdb[7] << 8) & 0xff00) | ((Cdb[8] << 0) & 0x00ff);
+ DWORD blenByte = blen * 0x200;
+ void *buf;
+
+ /*
+ * printk("SCSIOP_Write --- bn = %X, blen = %X, srb->use_sg = %X\n",
+ * bn, blen, srb->use_sg);
+ */

if (bn > us->bl_num)
return USB_STOR_TRANSPORT_ERROR;
--
1.7.4.1


2011-03-26 16:16:41

by Ralf Thielow

[permalink] [raw]
Subject: [PATCH 3/4] staging: keucr: smscsi: Removed commented declarations and statements.

Removed commented declarations and statements.

Signed-off-by: Ralf Thielow <[email protected]>
---
drivers/staging/keucr/smscsi.c | 25 -------------------------
1 files changed, 0 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/keucr/smscsi.c b/drivers/staging/keucr/smscsi.c
index 20386ce..f857be7 100644
--- a/drivers/staging/keucr/smscsi.c
+++ b/drivers/staging/keucr/smscsi.c
@@ -48,7 +48,6 @@ int SM_SCSIIrp(struct us_data *us, struct scsi_cmnd *srb)

int SM_SCSI_Test_Unit_Ready(struct us_data *us, struct scsi_cmnd *srb)
{
- /* printk("SM_SCSI_Test_Unit_Ready\n"); */
if (us->SM_Status.Insert && us->SM_Status.Ready) {
return USB_STOR_TRANSPORT_GOOD;
} else {
@@ -61,7 +60,6 @@ int SM_SCSI_Test_Unit_Ready(struct us_data *us, struct scsi_cmnd *srb)

int SM_SCSI_Inquiry(struct us_data *us, struct scsi_cmnd *srb)
{
- /* printk("SM_SCSI_Inquiry\n"); */
BYTE data_ptr[36] = {0x00, 0x80, 0x02, 0x00, 0x1F, 0x00,
0x00, 0x00, 0x55, 0x53, 0x42, 0x32,
0x2E, 0x30, 0x20, 0x20, 0x43, 0x61,
@@ -102,13 +100,6 @@ int SM_SCSI_Read_Capacity(struct us_data *us, struct scsi_cmnd *srb)
bl_len = 0x200;
bl_num = Ssfdc.MaxLogBlocks * Ssfdc.MaxSectors * Ssfdc.MaxZones - 1;

- /*
- * printk("MaxLogBlocks = %x\n", Ssfdc.MaxLogBlocks);
- * printk("MaxSectors = %x\n", Ssfdc.MaxSectors);
- * printk("MaxZones = %x\n", Ssfdc.MaxZones);
- * printk("bl_num = %x\n", bl_num);
- */
-
us->bl_num = bl_num;
printk(KERN_DEBUG, "bl_len = %x\n", bl_len);
printk(KERN_DEBUG, "bl_num = %x\n", bl_num);
@@ -123,17 +114,12 @@ int SM_SCSI_Read_Capacity(struct us_data *us, struct scsi_cmnd *srb)
buf[7] = (bl_len >> 0) & 0xff;

usb_stor_access_xfer_buf(us, buf, 8, srb, &sg, &offset, TO_XFER_BUF);
- /*
- * usb_stor_set_xfer_buf(us, buf, srb->request_bufflen,
- * srb, TO_XFER_BUF);
- */

return USB_STOR_TRANSPORT_GOOD;
}

int SM_SCSI_Read(struct us_data *us, struct scsi_cmnd *srb)
{
- /* struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; */
int result = 0;
PBYTE Cdb = srb->cmnd;
DWORD bn =
@@ -143,11 +129,6 @@ int SM_SCSI_Read(struct us_data *us, struct scsi_cmnd *srb)
DWORD blenByte = blen * 0x200;
void *buf;

- /*
- * printk("SCSIOP_READ --- bn = %X, blen = %X, srb->use_sg = %X\n",
- * bn, blen, srb->use_sg);
- */
-
if (bn > us->bl_num)
return USB_STOR_TRANSPORT_ERROR;

@@ -168,7 +149,6 @@ int SM_SCSI_Read(struct us_data *us, struct scsi_cmnd *srb)

int SM_SCSI_Write(struct us_data *us, struct scsi_cmnd *srb)
{
- /* struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; */
int result = 0;
PBYTE Cdb = srb->cmnd;
DWORD bn =
@@ -178,11 +158,6 @@ int SM_SCSI_Write(struct us_data *us, struct scsi_cmnd *srb)
DWORD blenByte = blen * 0x200;
void *buf;

- /*
- * printk("SCSIOP_Write --- bn = %X, blen = %X, srb->use_sg = %X\n",
- * bn, blen, srb->use_sg);
- */
-
if (bn > us->bl_num)
return USB_STOR_TRANSPORT_ERROR;

--
1.7.4.1

2011-03-26 16:16:39

by Ralf Thielow

[permalink] [raw]
Subject: [PATCH 2/4] staging: keucr: smscsi: Includes missing KERN_ facility level to printk().

Includes missing KERN_ facility level to printk().

Signed-off-by: Ralf Thielow <[email protected]>
---
drivers/staging/keucr/smscsi.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/keucr/smscsi.c b/drivers/staging/keucr/smscsi.c
index c3db085..20386ce 100644
--- a/drivers/staging/keucr/smscsi.c
+++ b/drivers/staging/keucr/smscsi.c
@@ -97,7 +97,7 @@ int SM_SCSI_Read_Capacity(struct us_data *us, struct scsi_cmnd *srb)
WORD bl_len;
BYTE buf[8];

- printk("SM_SCSI_Read_Capacity\n");
+ printk(KERN_DEBUG, "SM_SCSI_Read_Capacity\n");

bl_len = 0x200;
bl_num = Ssfdc.MaxLogBlocks * Ssfdc.MaxSectors * Ssfdc.MaxZones - 1;
@@ -110,8 +110,8 @@ int SM_SCSI_Read_Capacity(struct us_data *us, struct scsi_cmnd *srb)
*/

us->bl_num = bl_num;
- printk("bl_len = %x\n", bl_len);
- printk("bl_num = %x\n", bl_num);
+ printk(KERN_DEBUG, "bl_len = %x\n", bl_len);
+ printk(KERN_DEBUG, "bl_num = %x\n", bl_num);

buf[0] = (bl_num >> 24) & 0xff;
buf[1] = (bl_num >> 16) & 0xff;
--
1.7.4.1

2011-03-26 16:16:45

by Ralf Thielow

[permalink] [raw]
Subject: [PATCH 4/4] staging: keucr: smscsi: Removed unreachable return statements.

Removed unreachable return statements and simplify the logic by
avoid else-cases where it's not necessary.

Signed-off-by: Ralf Thielow <[email protected]>
---
drivers/staging/keucr/smscsi.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/keucr/smscsi.c b/drivers/staging/keucr/smscsi.c
index f857be7..38d4ab3 100644
--- a/drivers/staging/keucr/smscsi.c
+++ b/drivers/staging/keucr/smscsi.c
@@ -54,8 +54,6 @@ int SM_SCSI_Test_Unit_Ready(struct us_data *us, struct scsi_cmnd *srb)
ENE_SMInit(us);
return USB_STOR_TRANSPORT_GOOD;
}
-
- return USB_STOR_TRANSPORT_GOOD;
}

int SM_SCSI_Inquiry(struct us_data *us, struct scsi_cmnd *srb)
@@ -141,10 +139,8 @@ int SM_SCSI_Read(struct us_data *us, struct scsi_cmnd *srb)

if (!result)
return USB_STOR_TRANSPORT_GOOD;
- else
- return USB_STOR_TRANSPORT_ERROR;

- return USB_STOR_TRANSPORT_GOOD;
+ return USB_STOR_TRANSPORT_ERROR;
}

int SM_SCSI_Write(struct us_data *us, struct scsi_cmnd *srb)
@@ -170,9 +166,7 @@ int SM_SCSI_Write(struct us_data *us, struct scsi_cmnd *srb)

if (!result)
return USB_STOR_TRANSPORT_GOOD;
- else
- return USB_STOR_TRANSPORT_ERROR;

- return USB_STOR_TRANSPORT_GOOD;
+ return USB_STOR_TRANSPORT_ERROR;
}

--
1.7.4.1

2011-03-26 18:51:29

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 2/4] staging: keucr: smscsi: Includes missing KERN_ facility level to printk().

On Sat, 2011-03-26 at 17:16 +0100, Ralf Thielow wrote:
> Includes missing KERN_ facility level to printk().
[]
> diff --git a/drivers/staging/keucr/smscsi.c b/drivers/staging/keucr/smscsi.c
[]
> @@ -97,7 +97,7 @@ int SM_SCSI_Read_Capacity(struct us_data *us, struct scsi_cmnd *srb)
> WORD bl_len;
> BYTE buf[8];
>
> - printk("SM_SCSI_Read_Capacity\n");
> + printk(KERN_DEBUG, "SM_SCSI_Read_Capacity\n");

There should not be a comma between KERN_<level> and format.

Compile tested?

> + printk(KERN_DEBUG, "bl_len = %x\n", bl_len);
> + printk(KERN_DEBUG, "bl_num = %x\n", bl_num);

2011-03-26 19:11:46

by Ralf Thielow

[permalink] [raw]
Subject: Re: [PATCH 2/4] staging: keucr: smscsi: Includes missing KERN_ facility level to printk().

Of course, the whole staging directory with "make clean
M=drivers/staging && make M=drivers/staging".
You're right. The "printk" function accept these but it's wrong.

Thanks

2011/3/26 Joe Perches <[email protected]>:
> On Sat, 2011-03-26 at 17:16 +0100, Ralf Thielow wrote:
>> Includes missing KERN_ facility level to printk().
> []
>> diff --git a/drivers/staging/keucr/smscsi.c b/drivers/staging/keucr/smscsi.c
> []
>> @@ -97,7 +97,7 @@ int SM_SCSI_Read_Capacity(struct us_data *us, struct scsi_cmnd *srb)
>>       WORD bl_len;
>>       BYTE buf[8];
>>
>> -     printk("SM_SCSI_Read_Capacity\n");
>> +     printk(KERN_DEBUG, "SM_SCSI_Read_Capacity\n");
>
> There should not be a comma between KERN_<level> and format.
>
> Compile tested?
>
>> +     printk(KERN_DEBUG, "bl_len = %x\n", bl_len);
>> +     printk(KERN_DEBUG, "bl_num = %x\n", bl_num);
>
>
>

2011-03-26 19:26:54

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 2/4] staging: keucr: smscsi: Includes missing KERN_ facility level to printk().

On Sat, 2011-03-26 at 20:11 +0100, Ralf Thielow wrote:
> Of course, the whole staging directory with "make clean
> M=drivers/staging && make M=drivers/staging".
> You're right. The "printk" function accept these but it's wrong.

Then you didn't really compile test it.
I suggest you check your compilation commands.

For instance:

diff --git a/drivers/staging/keucr/smscsi.c b/drivers/staging/keucr/smscsi.c
index 6211686..dd3cf95 100644
--- a/drivers/staging/keucr/smscsi.c
+++ b/drivers/staging/keucr/smscsi.c
@@ -98,7 +98,7 @@ int SM_SCSI_Read_Capacity(struct us_data *us, struct scsi_cmnd *srb)
WORD bl_len;
BYTE buf[8];

- printk("SM_SCSI_Read_Capacity\n");
+ printk(KERN_DEBUG, "SM_SCSI_Read_Capacity\n");

bl_len = 0x200;
bl_num = Ssfdc.MaxLogBlocks * Ssfdc.MaxSectors * Ssfdc.MaxZones - 1;

$ make drivers/staging/keucr/smscsi.o
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
CC drivers/staging/keucr/smscsi.o
drivers/staging/keucr/smscsi.c: In function ‘SM_SCSI_Read_Capacity’:
drivers/staging/keucr/smscsi.c:101:2: warning: too many arguments for format

2011-03-26 19:33:06

by Ralf Thielow

[permalink] [raw]
Subject: Re: [PATCH 2/4] staging: keucr: smscsi: Includes missing KERN_ facility level to printk().

Ooops, i thougth i can trust "make M=***".

Thanks!

2011/3/26 Joe Perches <[email protected]>:
> On Sat, 2011-03-26 at 20:11 +0100, Ralf Thielow wrote:
>> Of course, the whole staging directory with "make clean
>> M=drivers/staging && make M=drivers/staging".
>> You're right. The "printk" function accept these but it's wrong.
>
> Then you didn't really compile test it.
> I suggest you check your compilation commands.
>
> For instance:
>
> diff --git a/drivers/staging/keucr/smscsi.c b/drivers/staging/keucr/smscsi.c
> index 6211686..dd3cf95 100644
> --- a/drivers/staging/keucr/smscsi.c
> +++ b/drivers/staging/keucr/smscsi.c
> @@ -98,7 +98,7 @@ int SM_SCSI_Read_Capacity(struct us_data *us, struct scsi_cmnd *srb)
>        WORD    bl_len;
>        BYTE    buf[8];
>
> -       printk("SM_SCSI_Read_Capacity\n");
> +       printk(KERN_DEBUG, "SM_SCSI_Read_Capacity\n");
>
>        bl_len = 0x200;
>        bl_num = Ssfdc.MaxLogBlocks * Ssfdc.MaxSectors * Ssfdc.MaxZones - 1;
>
> $ make drivers/staging/keucr/smscsi.o
>  CHK     include/linux/version.h
>  CHK     include/generated/utsrelease.h
>  CALL    scripts/checksyscalls.sh
>  CC      drivers/staging/keucr/smscsi.o
> drivers/staging/keucr/smscsi.c: In function ‘SM_SCSI_Read_Capacity’:
> drivers/staging/keucr/smscsi.c:101:2: warning: too many arguments for format
>
>
>