From 75b9130e8af64c6878a1aa396a8446f3ce2cfb49 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 16 Apr 2013 22:44:07 -0700 Subject: usb: storage: Add usb_stor_dbg, reduce object size Reduce the size of the objects by consolidating the duplicated USB_STORAGE into a single function. Add function usb_stor_dbg to emit debugging messages. Always validate the format and arguments. Reduce the number of uses of CONFIG_USB_STORAGE_DEBUG. Reduces size of objects ~7KB when CONFIG_USB_STORAGE_DEBUG is set. $ size drivers/usb/storage/built-in.o* text data bss dec hex filename 140133 55296 70312 265741 40e0d drivers/usb/storage/built-in.o.new 147494 55248 70296 273038 42a8e drivers/usb/storage/built-in.o.old Signed-off-by: Joe Perches Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/isd200.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/usb/storage/isd200.c') diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c index 06a3d22db685..55571ae59592 100644 --- a/drivers/usb/storage/isd200.c +++ b/drivers/usb/storage/isd200.c @@ -926,10 +926,6 @@ static int isd200_try_enum(struct us_data *us, unsigned char master_slave, /* loop until we detect !BSY or timeout */ while(1) { -#ifdef CONFIG_USB_STORAGE_DEBUG - char* mstr = master_slave == ATA_ADDRESS_DEVHEAD_STD ? - "Master" : "Slave"; -#endif status = isd200_action( us, ACTION_ENUM, NULL, master_slave ); if ( status != ISD200_GOOD ) @@ -942,9 +938,13 @@ static int isd200_try_enum(struct us_data *us, unsigned char master_slave, if (!detect) { if (regs[ATA_REG_STATUS_OFFSET] & ATA_BUSY) { - US_DEBUGP(" %s status is still BSY, try again...\n",mstr); + US_DEBUGP(" %s status is still BSY, try again...\n", + master_slave == ATA_ADDRESS_DEVHEAD_STD ? + "Master" : "Slave"); } else { - US_DEBUGP(" %s status !BSY, continue with next operation\n",mstr); + US_DEBUGP(" %s status !BSY, continue with next operation\n", + master_slave == ATA_ADDRESS_DEVHEAD_STD ? + "Master" : "Slave"); break; } } -- cgit v1.2.3