drivers/usb/storage/: cleanups
Subsystems (2)
PATCH 1/1 drivers/usb/storage/: cleanups
This patch contains the following cleanups:
- make needlessly global code static
- scsiglue.c: remove the unused usb_stor_sense_notready
Signed-off-by Adrian Bunk <[email protected]>
---
drivers/usb/storage/scsiglue.c | 9 --------- drivers/usb/storage/scsiglue.h | 1 - drivers/usb/storage/shuttle_usbat.c | 13 ++++++++----- drivers/usb/storage/shuttle_usbat.h | 4 ---- drivers/usb/storage/transport.c | 5 +++-- drivers/usb/storage/transport.h | 5 ----- drivers/usb/storage/usb.c | 4 ++-- drivers/usb/storage/usb.h | 3 --- 8 files changed, 13 insertions(+), 31 deletions(-)
drivers/usb/storage/scsiglue.h renamed from drivers/usb/storage/scsiglue.h.old +0 -1
@@ -48,7 +48,6 @@extern void usb_stor_report_device_reset (struct us_data *us); -extern unsigned char usb_stor_sense_notready[18 ];extern unsigned char usb_stor_sense_invalidCDB[18 ];extern struct scsi_host_template usb_stor_host_template;
drivers/usb/storage/scsiglue.c renamed from drivers/usb/storage/scsiglue.c.old +0 -9
@@ -477,15 +477,6 @@ .module = THIS_MODULE }; -/* For a device that is "Not Ready" */ -unsigned char usb_stor_sense_notready[18 ] = { - [0 ] =0x70 ,/* current error */ - [2 ] =0x02 ,/* not ready */ - [7 ] =0x0a ,/* additional length */ - [12 ] =0x04 ,/* not ready */ - [13 ] =0x03 /* manual intervention */ -}; -/* To Report "Illegal Request: Invalid Field in CDB */ unsigned char usb_stor_sense_invalidCDB[18 ] = { [0 ] =0x70 ,/* current error */
drivers/usb/storage/shuttle_usbat.h renamed from drivers/usb/storage/shuttle_usbat.h.old +0 -4
@@ -105,10 +105,6 @@#define USBAT_FEAT_ET1 0x02#define USBAT_FEAT_ET2 0x01 -/* Transport functions */ -int usbat_hp8200e_transport (struct scsi_cmnd *srb,struct us_data *us); -int usbat_flash_transport (struct scsi_cmnd * srb,struct us_data *us); -extern int usbat_transport (struct scsi_cmnd *srb,struct us_data *us);extern int init_usbat (struct us_data *us);
drivers/usb/storage/shuttle_usbat.c renamed from drivers/usb/storage/shuttle_usbat.c.old +8 -5
@@ -61,7 +61,10 @@#define LSB_of (s) ((s)&0xFF)#define MSB_of (s) ((s)>>8) -int transferred =0 ; +static int transferred =0 ; + +static int usbat_flash_transport (struct scsi_cmnd * srb,struct us_data *us); +static int usbat_hp8200e_transport (struct scsi_cmnd *srb,struct us_data *us);/* * Convenience function to produce an ATAPI read/write sectors command
@@ -872,8 +875,8 @@/* * Set the transport function based on the device type */ -int usbat_set_transport (struct us_data *us, -struct usbat_info *info) +static int usbat_set_transport (struct us_data *us, +struct usbat_info *info) {int rc;
@@ -1417,7 +1420,7 @@/* * Transport for the HP 8200e */ -int usbat_hp8200e_transport (struct scsi_cmnd *srb,struct us_data *us) +static int usbat_hp8200e_transport (struct scsi_cmnd *srb,struct us_data *us) {int result;unsigned char *status = us->iobuf;
@@ -1560,7 +1563,7 @@/* * Transport for USBAT02-based CompactFlash and similar storage devices */ -int usbat_flash_transport (struct scsi_cmnd * srb,struct us_data *us) +static int usbat_flash_transport (struct scsi_cmnd * srb,struct us_data *us) {int rc;struct usbat_info *info = (struct usbat_info *) (us->extra);
drivers/usb/storage/transport.h renamed from drivers/usb/storage/transport.h.old +0 -5
@@ -169,13 +169,8 @@extern int usb_stor_ctrl_transfer (struct us_data *us,unsigned int pipe,u8 request,u8 requesttype,u16 value,u16 index,void *data,u16 size); -extern int usb_stor_intr_transfer (struct us_data *us,void *buf, -unsigned int length);extern int usb_stor_bulk_transfer_buf (struct us_data *us,unsigned int pipe,void *buf,unsigned int length,unsigned int *act_len); -extern int usb_stor_bulk_transfer_sglist (struct us_data *us,unsigned int pipe, -struct scatterlist *sg,int num_sg,unsigned int length, -unsigned int *act_len);extern int usb_stor_bulk_transfer_sg (struct us_data *us,unsigned int pipe,void *buf,unsigned int length,int use_sg,int *residual);
drivers/usb/storage/transport.c renamed from drivers/usb/storage/transport.c.old +3 -2
@@ -383,7 +383,8 @@* This routine always uses us->recv_intr_pipe as the pipe and * us->ep_bInterval as the interrupt interval. */ -int usb_stor_intr_transfer (struct us_data *us,void *buf,unsigned int length) +static int usb_stor_intr_transfer (struct us_data *us,void *buf, +unsigned int length) {int result;unsigned int pipe = us->recv_intr_pipe;
@@ -436,7 +437,7 @@* This function does basically the same thing as usb_stor_bulk_transfer_buf() * above, but it uses the usbcore scatter-gather library. */ -int usb_stor_bulk_transfer_sglist (struct us_data *us,unsigned int pipe, +static int usb_stor_bulk_transfer_sglist (struct us_data *us,unsigned int pipe,struct scatterlist *sg,int num_sg,unsigned int length,unsigned int *act_len) {
drivers/usb/storage/usb.h renamed from drivers/usb/storage/usb.h.old +0 -3
@@ -167,9 +167,6 @@extra_data_destructor extra_destructor;/* extra data destructor */ }; -/* The structure which defines our driver */ -extern struct usb_driver usb_storage_driver; -/* Function to fill an inquiry response. See usb.c for details */ extern void fill_inquiry_response (struct us_data *us,unsigned char *data,unsigned int data_len);
drivers/usb/storage/usb.c renamed from drivers/usb/storage/usb.c.old +2 -2
@@ -225,7 +225,7 @@ { NULL } }; -struct usb_driver usb_storage_driver = { +static struct usb_driver usb_storage_driver = { .owner =THIS_MODULE , .name ="usb-storage" , .probe = storage_probe,
@@ -811,7 +811,7 @@ }/* Release all our dynamic resources */ -void usb_stor_release_resources (struct us_data *us) +static void usb_stor_release_resources (struct us_data *us) {US_DEBUGP ("-- %s\n" , __FUNCTION__);
Greg KH
AppliedQuoted 5 lines · Adrian Bunk
This patch contains the following cleanups:
- make needlessly global code static
-scsiglue.c: remove the unusedusb_stor_sense_notreadySigned-off-by Adrian Bunk <[email protected]>
Applied, thanks.
greg k-h