aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Munsie <imunsie@au.ibm.com>2010-03-02 19:00:37 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:31 -0400
commit0df4d8ef77f7e1251763d429f5ddbf5373961714 (patch)
tree5f99a500f7708f2675013c728e0e9998a7b941e4
parentfa4dc36482a5236c92c589cdbc0a42ff5c945b6b (diff)
USB: Remove large struct from the stack in USB storage isd200 driver
The compiler throws the following warning when compiling for a PowerPC 64 bit machine: drivers/usb/storage/isd200.c:580: warning: the frame size of 2208 bytes is larger than 2048 bytes There is a struct scsi_device which is placed on the stack and is largely responsible for such wastage. The struct is just a dummy struct filled with NULLs and set as the scsi_cmnd->device to make the usb_stor_Bulk_transport function happy. This patch makes the struct static, so that it is never placed onto the stack and silences the compiler warning. Signed-off-by: Ian Munsie <imunsie@au.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/storage/isd200.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
index fdba2f69d4c9..e9cbc1467f76 100644
--- a/drivers/usb/storage/isd200.c
+++ b/drivers/usb/storage/isd200.c
@@ -490,13 +490,13 @@ static int isd200_action( struct us_data *us, int action,
490 void* pointer, int value ) 490 void* pointer, int value )
491{ 491{
492 union ata_cdb ata; 492 union ata_cdb ata;
493 struct scsi_device srb_dev; 493 /* static to prevent this large struct being placed on the valuable stack */
494 static struct scsi_device srb_dev;
494 struct isd200_info *info = (struct isd200_info *)us->extra; 495 struct isd200_info *info = (struct isd200_info *)us->extra;
495 struct scsi_cmnd *srb = &info->srb; 496 struct scsi_cmnd *srb = &info->srb;
496 int status; 497 int status;
497 498
498 memset(&ata, 0, sizeof(ata)); 499 memset(&ata, 0, sizeof(ata));
499 memset(&srb_dev, 0, sizeof(srb_dev));
500 srb->cmnd = info->cmnd; 500 srb->cmnd = info->cmnd;
501 srb->device = &srb_dev; 501 srb->device = &srb_dev;
502 ++srb->serial_number; 502 ++srb->serial_number;