Skip to contentSkip to conversation

Sparse fixes

PATCH New Felipe Balbi 1 participant 14 messages Nov 15, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Sparse fixes

Hi Greg,

Here are a few sparse fixups for the storage drivers. Compile tested with allyesconfig and allmodconfig.

Felipe Balbi (13):
usb: storage: alauda: fix sparse warnings
usb: storage: cypress: fix sparse warning
usb: storage: datafab: fix sparse warning
usb: storage: ene_ub6250: fix sparse warnings
usb: storage: freecom: fix sparse warning
usb: storage: isd200: fix sparse warning
usb: storage: jumpshot: fix sparse warning
usb: storage: karma: fix sparse warning
usb: storage: onetouch: fix sparse warning
usb: storagE: realtek_cr: fix sparse warnings
usb: storage: sddr09: fix sparse warning
usb: storage: sddr55: fix sparse warning
usb: storage: shuttle_usbat: fix sparse warning

 drivers/usb/storage/alauda.c        |    2 +-
 drivers/usb/storage/cypress_atacb.c |    2 +-
 drivers/usb/storage/datafab.c       |    2 +-
 drivers/usb/storage/ene_ub6250.c    |   12 ++++++------
 drivers/usb/storage/freecom.c       |    2 +-
 drivers/usb/storage/isd200.c        |    2 +-
 drivers/usb/storage/jumpshot.c      |    2 +-
 drivers/usb/storage/karma.c         |    2 +-
 drivers/usb/storage/onetouch.c      |    2 +-
 drivers/usb/storage/realtek_cr.c    |   11 +++++------
 drivers/usb/storage/sddr09.c        |    2 +-
 drivers/usb/storage/sddr55.c        |    2 +-
 drivers/usb/storage/shuttle_usbat.c |    2 +-
 13 files changed, 22 insertions(+), 23 deletions(-)
Signature · 1 line
1.7.8.rc0
#1 lore raw

PATCH 1/13 usb: storage: alauda: fix sparse warnings

Fix the following warning:

| drivers/usb/storage/alauda.c:142:22: warning: symbol
|	'alauda_usb_ids' was not declared. Should it
|	be static?
---
 drivers/usb/storage/alauda.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/alauda.c +1 -1
index 42d0eae..9ce3bba 100644
@@ -139,7 +139,7 @@ static int init_alauda(struct us_data *us);
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id alauda_usb_ids[] = {
+static struct usb_device_id alauda_usb_ids[] = {
 #	include "unusual_alauda.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0
#2 lore raw

PATCH 2/13 usb: storage: cypress: fix sparse warning

In reply to Felipe Balbi

Fix the following sparse warning:

| drivers/usb/storage/cypress_atacb.c:46:22: warning:
|	symbol 'cypress_usb_ids' was not declared. Should
|	it be static?
---
 drivers/usb/storage/cypress_atacb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/cypress_atacb.c +1 -1
index c844718..740bfe6 100644
@@ -43,7 +43,7 @@ MODULE_LICENSE("GPL");
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id cypress_usb_ids[] = {
+static struct usb_device_id cypress_usb_ids[] = {
 #	include "unusual_cypress.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0
#3 lore raw

PATCH 3/13 usb: storage: datafab: fix sparse warning

In reply to Felipe Balbi

Fix the following sparse warning:

| drivers/usb/storage/datafab.c:91:22: warning: symbol
|	'datafab_usb_ids' was not declared. Should it
|	be static?
---
 drivers/usb/storage/datafab.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/datafab.c +1 -1
index ded836b..0d8d97c 100644
@@ -88,7 +88,7 @@ static int datafab_determine_lun(struct us_data *us,
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id datafab_usb_ids[] = {
+static struct usb_device_id datafab_usb_ids[] = {
 #	include "unusual_datafab.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0
#4 lore raw

PATCH 4/13 usb: storage: ene_ub6250: fix sparse warnings

In reply to Felipe Balbi

Fix the following sparse warnings:

| drivers/usb/storage/ene_ub6250.c:45:22: warning: symbol
|	'ene_ub6250_usb_ids' was not declared. Should it
|	be static?
|
| drivers/usb/storage/ene_ub6250.c:780:5: warning: symbol
|	'ms_lib_alloc_logicalmap' was not declared. Should it
|	be static?
|
| drivers/usb/storage/ene_ub6250.c:2251:5: warning: symbol
|	'ms_scsi_irp' was not declared. Should it be static?
|
| drivers/usb/storage/ene_ub6250.c:638:29: warning: right shift by bigger
|	than source value
|
| drivers/usb/storage/ene_ub6250.c:639:29: warning: right shift by bigger
|	than source value
---
 drivers/usb/storage/ene_ub6250.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/usb/storage/ene_ub6250.c +6 -6
index 9fbe742..b990726 100644
@@ -42,7 +42,7 @@ MODULE_LICENSE("GPL");
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
 	.driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id ene_ub6250_usb_ids[] = {
+static struct usb_device_id ene_ub6250_usb_ids[] = {
 #	include "unusual_ene_ub6250.h"
 	{ }		/* Terminating entry */
 };
@@ -607,8 +607,8 @@ static int sd_scsi_mode_sense(struct us_data *us, struct scsi_cmnd *srb)
 
 static int sd_scsi_read_capacity(struct us_data *us, struct scsi_cmnd *srb)
 {
-	u32   bl_num;
-	u16    bl_len;
+	u32	bl_num;
+	u32	bl_len;
 	unsigned int offset = 0;
 	unsigned char    buf[8];
 	struct scatterlist *sg = NULL;
@@ -622,7 +622,7 @@ static int sd_scsi_read_capacity(struct us_data *us, struct scsi_cmnd *srb)
 		else
 			bl_num = (info->HC_C_SIZE + 1) * 1024 - 1;
 	} else {
-		bl_len = 1<<(info->SD_READ_BL_LEN);
+		bl_len = 1 << (info->SD_READ_BL_LEN);
 		bl_num = info->SD_Block_Mult * (info->SD_C_SIZE + 1)
 				* (1 << (info->SD_C_SIZE_MULT + 2)) - 1;
 	}
@@ -777,7 +777,7 @@ static int ms_lib_free_logicalmap(struct us_data *us)
 	return 0;
 }
 
-int ms_lib_alloc_logicalmap(struct us_data *us)
+static int ms_lib_alloc_logicalmap(struct us_data *us)
 {
 	u32  i;
 	struct ene_ub6250_info *info = (struct ene_ub6250_info *) us->extra;
@@ -2248,7 +2248,7 @@ static int sd_scsi_irp(struct us_data *us, struct scsi_cmnd *srb)
 /*
  * ms_scsi_irp()
  */
-int ms_scsi_irp(struct us_data *us, struct scsi_cmnd *srb)
+static int ms_scsi_irp(struct us_data *us, struct scsi_cmnd *srb)
 {
 	int result;
 	struct ene_ub6250_info *info = (struct ene_ub6250_info *)us->extra;
Signature · 1 line
1.7.8.rc0
#5 lore raw

PATCH 5/13 usb: storage: freecom: fix sparse warning

In reply to Felipe Balbi

Fix the following sparse warning:

| drivers/usb/storage/freecom.c:122:22: warning: symbol
|	'freecom_usb_ids' was not declared. Should it
|	be static?
---
 drivers/usb/storage/freecom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/freecom.c +1 -1
index 6542ca4..8cf16f8 100644
@@ -119,7 +119,7 @@ static int init_freecom(struct us_data *us);
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id freecom_usb_ids[] = {
+static struct usb_device_id freecom_usb_ids[] = {
 #	include "unusual_freecom.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0
#6 lore raw

PATCH 6/13 usb: storage: isd200: fix sparse warning

In reply to Felipe Balbi

Fix the following sparse warning:

| drivers/usb/storage/freecom.c:122:22: warning: symbol
|	'freecom_usb_ids' was not declared. Should it
|	be static?
---
 drivers/usb/storage/isd200.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/isd200.c +1 -1
index ffc4193..7b81303 100644
@@ -76,7 +76,7 @@ static int isd200_Initialization(struct us_data *us);
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id isd200_usb_ids[] = {
+static struct usb_device_id isd200_usb_ids[] = {
 #	include "unusual_isd200.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0
#7 lore raw

PATCH 7/13 usb: storage: jumpshot: fix sparse warning

In reply to Felipe Balbi

Fix the following sparse warning:

| drivers/usb/storage/jumpshot.c:74:22: warning: symbol
|	'jumpshot_usb_ids' was not declared. Should it
|	be static?
---
 drivers/usb/storage/jumpshot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/jumpshot.c +1 -1
index 6168596..5ef55c7 100644
@@ -71,7 +71,7 @@ MODULE_LICENSE("GPL");
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id jumpshot_usb_ids[] = {
+static struct usb_device_id jumpshot_usb_ids[] = {
 #	include "unusual_jumpshot.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0
#8 lore raw

PATCH 8/13 usb: storage: karma: fix sparse warning

In reply to Felipe Balbi

Fix the following sparse warning:

| drivers/usb/storage/karma.c:62:22: warning: symbol
|	'karma_usb_ids' was not declared. Should it
|	be static?
---
 drivers/usb/storage/karma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/karma.c +1 -1
index ba1b789..fb5bfb0 100644
@@ -59,7 +59,7 @@ static int rio_karma_init(struct us_data *us);
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id karma_usb_ids[] = {
+static struct usb_device_id karma_usb_ids[] = {
 #	include "unusual_karma.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0
#9 lore raw

PATCH 9/13 usb: storage: onetouch: fix sparse warning

In reply to Felipe Balbi

Fix the following sparse warning:

| drivers/usb/storage/onetouch.c:72:22: warning: symbol
|	'onetouch_usb_ids' was not declared. Should it
|	be static?
---
 drivers/usb/storage/onetouch.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/onetouch.c +1 -1
index 1943be5..d29be3e 100644
@@ -69,7 +69,7 @@ struct usb_onetouch {
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id onetouch_usb_ids[] = {
+static struct usb_device_id onetouch_usb_ids[] = {
 #	include "unusual_onetouch.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0
#10 lore raw

PATCH 10/13 usb: storagE: realtek_cr: fix sparse warnings

In reply to Felipe Balbi

Fix the following sparse warnings:

| drivers/usb/storage/realtek_cr.c:821:6: warning: symbol
|	'rts51x_invoke_transport' was not declared. Should
|	it be static?
|
| drivers/usb/storage/realtek_cr.c:980:5: warning: symbol
|	'realtek_cr_suspend' was not declared. Should it
|	be static?
|
| drivers/usb/storage/realtek_cr.c:518:23: warning: cast
|	truncates bits from constant value (fe47 becomes 47)
---
 drivers/usb/storage/realtek_cr.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
drivers/usb/storage/realtek_cr.c +5 -6
index 0ce5f79..30f64bf 100644
@@ -507,15 +507,14 @@ static int enable_oscillator(struct us_data *us)
 static int __do_config_autodelink(struct us_data *us, u8 *data, u16 len)
 {
 	int retval;
-	u16 addr = 0xFE47;
 	u8 cmnd[12] = {0};
 
-	US_DEBUGP("%s, addr = 0x%x, len = %d\n", __FUNCTION__, addr, len);
+	US_DEBUGP("%s, addr = 0xfe47, len = %d\n", __FUNCTION__, len);
 
 	cmnd[0] = 0xF0;
 	cmnd[1] = 0x0E;
-	cmnd[2] = (u8)(addr >> 8);
-	cmnd[3] = (u8)addr;
+	cmnd[2] = 0xfe;
+	cmnd[3] = 0x47;
 	cmnd[4] = (u8)(len >> 8);
 	cmnd[5] = (u8)len;
 
@@ -818,7 +817,7 @@ static inline int working_scsi(struct scsi_cmnd *srb)
 	return 1;
 }
 
-void rts51x_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
+static void rts51x_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
 {
 	struct rts51x_chip *chip = (struct rts51x_chip *)(us->extra);
 	static int card_first_show = 1;
@@ -977,7 +976,7 @@ static void realtek_cr_destructor(void *extra)
 }
 
 #ifdef CONFIG_PM
-int realtek_cr_suspend(struct usb_interface *iface, pm_message_t message)
+static int realtek_cr_suspend(struct usb_interface *iface, pm_message_t message)
 {
 	struct us_data *us = usb_get_intfdata(iface);
 
Signature · 1 line
1.7.8.rc0
#11 lore raw

PATCH 11/13 usb: storage: sddr09: fix sparse warning

In reply to Felipe Balbi

Fix the following sparse warning:

| drivers/usb/storage/sddr09.c:74:22: warning: symbol
|	'sddr09_usb_ids' was not declared. Should it
|	be static?
---
 drivers/usb/storage/sddr09.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/sddr09.c +1 -1
index bcb9a70..6ecbf44 100644
@@ -71,7 +71,7 @@ static int usb_stor_sddr09_init(struct us_data *us);
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id sddr09_usb_ids[] = {
+static struct usb_device_id sddr09_usb_ids[] = {
 #	include "unusual_sddr09.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0
#12 lore raw

PATCH 12/13 usb: storage: sddr55: fix sparse warning

In reply to Felipe Balbi

Fix the following sparse warning:

| drivers/usb/storage/sddr55.c:51:22: warning: symbol
|	'sddr55_usb_ids' was not declared. Should it
|	be static?
---
 drivers/usb/storage/sddr55.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/sddr55.c +1 -1
index 44dfed7..f293044 100644
@@ -48,7 +48,7 @@ MODULE_LICENSE("GPL");
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id sddr55_usb_ids[] = {
+static struct usb_device_id sddr55_usb_ids[] = {
 #	include "unusual_sddr55.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0
#13 lore raw

PATCH 13/13 usb: storage: shuttle_usbat: fix sparse warning

In reply to Felipe Balbi

Fix the following sparse warning:

| drivers/usb/storage/shuttle_usbat.c:173:22: warning:
|	symbol 'usbat_usb_ids' was not declared. Should
|	it be static?
---
 drivers/usb/storage/shuttle_usbat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/storage/shuttle_usbat.c +1 -1
index 0b00091..7d642c8 100644
@@ -170,7 +170,7 @@ static int init_usbat_flash(struct us_data *us);
 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
   .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
 
-struct usb_device_id usbat_usb_ids[] = {
+static struct usb_device_id usbat_usb_ids[] = {
 #	include "unusual_usbat.h"
 	{ }		/* Terminating entry */
 };
Signature · 1 line
1.7.8.rc0