USB: add missing KERN_* constants to printks
Subsystems (3)
PATCH 1/1 USB: add missing KERN_* constants to printks
From: Frank Seidel <[email protected]>
According to kerneljanitors todo list all printk calls (beginning a new line) should have an according KERN_* constant. Those are the missing peaces here for the usb subsystem.
Signed-off-by Frank Seidel <[email protected]>
--- drivers/usb/gadget/fsl_usb2_udc.c | 8 +++++--- drivers/usb/gadget/lh7a40x_udc.c | 16 +++++++++------- drivers/usb/host/isp116x.h | 8 ++++---- drivers/usb/storage/alauda.c | 25 ++++++++++++++++--------- drivers/usb/storage/sddr09.c | 37 ++++++++++++++++++++++--------------- drivers/usb/storage/sddr55.c | 4 +++- 6 files changed, 59 insertions(+), 39 deletions(-)
drivers/usb/host/isp116x.h +4 -4
@@ -563,7 +563,7 @@ static void urb_dbg(struct urb *urb, cha*/ static inline void dump_ptd (struct ptd *ptd) { - printk("td: %x %d%c%d %d,%d,%d %x %x%x%x\n", + printk(KERN_WARNING "td: %x %d%c%d %d,%d,%d %x %x%x%x\n", PTD_GET_CC(ptd), PTD_GET_FA(ptd), PTD_DIR_STR(ptd), PTD_GET_EP(ptd), PTD_GET_COUNT(ptd), PTD_GET_LEN(ptd), PTD_GET_MPS(ptd),
@@ -576,7 +576,7 @@ static inline void dump_ptd_out_data(strint k;if (PTD_GET_DIR (ptd) !=PTD_DIR_IN &&PTD_GET_LEN (ptd)) { -printk ("-> " ); +printk (KERN_WARNING "-> " );for (k =0 ; k <PTD_GET_LEN (ptd); ++k)printk ("%02x " , ((u8 *) buf)[k]);printk ("\n" );
@@ -588,13 +588,13 @@ static inline void dump_ptd_in_data(struint k;if (PTD_GET_DIR (ptd) ==PTD_DIR_IN &&PTD_GET_COUNT (ptd)) { -printk ("<- " ); +printk (KERN_WARNING "<- " );for (k =0 ; k <PTD_GET_COUNT (ptd); ++k)printk ("%02x " , ((u8 *) buf)[k]);printk ("\n" ); }if (PTD_GET_LAST (ptd)) - printk("-\n"); + printk(KERN_WARNING "-\n"); }#else
drivers/usb/gadget/fsl_usb2_udc.c +5 -3
@@ -1799,7 +1799,8 @@ int usb_gadget_register_driver(struct us out:if (retval) -printk ("gadget driver register failed %d\n" , retval); +printk (KERN_WARNING "gadget driver register failed %d\n" , + retval);return retval; }EXPORT_SYMBOL (usb_gadget_register_driver);
@@ -1844,7 +1845,8 @@ int usb_gadget_unregister_driver(struct udc_controller->gadget.dev.driver =NULL ; udc_controller->driver =NULL ; -printk ("unregistered gadget driver '%s'\n" , driver->driver.name); +printk (KERN_WARNING "unregistered gadget driver '%s'\n" , + driver->driver.name);return 0 ; }EXPORT_SYMBOL (usb_gadget_unregister_driver);
@@ -2452,7 +2454,7 @@ module_init(udc_init); static void __exit udc_exit(void) {platform_driver_unregister (&udc_driver); -printk ("%s unregistered\n" , driver_desc); +printk (KERN_WARNING "%s unregistered\n" , driver_desc); }module_exit (udc_exit);
drivers/usb/gadget/lh7a40x_udc.c +9 -7
@@ -432,8 +432,8 @@ int usb_gadget_register_driver(struct usdevice_add (&dev->gadget.dev); retval = driver->bind (&dev->gadget);if (retval) { -printk ("%s: bind to driver %s --> error %d\n" , dev->gadget.name, - driver->driver.name, retval); +printk (KERN_WARNING "%s: bind to driver %s --> error %d\n" , + dev->gadget.name, driver->driver.name, retval);device_del (&dev->gadget.dev); dev->driver =0 ;
@@ -445,8 +445,8 @@ int usb_gadget_register_driver(struct us* for set_configuration as well as eventual disconnect. * NOTE: this shouldn't power up until later. */ -printk ("%s: registered gadget driver '%s'\n" , dev->gadget.name, - driver->driver.name); +printk (KERN_WARNING "%s: registered gadget driver '%s'\n" , + dev->gadget.name, driver->driver.name);udc_enable (dev);
@@ -581,7 +581,8 @@ static int read_fifo(struct lh7a40x_ep ** discard the extra data. */ if (req->req.status != -EOVERFLOW ) -printk ("%s overflow %d\n" , ep->ep.name, count); +printk (KERN_WARNING "%s overflow %d\n" , + ep->ep.name, count); req->req.status = -EOVERFLOW ; }else { *buf++ = byte;
@@ -831,7 +832,8 @@ static void lh7a40x_out_epn(struct lh7a4 queue);if (!req) { -printk ("%s: NULL REQ %d\n" , +printk (KERN_WARNING +"%s: NULL REQ %d\n" , __func__, ep_idx);flush (ep);break ;
@@ -844,7 +846,7 @@ static void lh7a40x_out_epn(struct lh7a4 }else {/* Throw packet away.. */ -printk ("%s: No descriptor?!?\n" , __func__); +printk (KERN_WARNING "%s: No descriptor?!?\n" , __func__);flush (ep); } }
drivers/usb/storage/sddr09.c +22 -15
@@ -723,7 +723,7 @@ sddr09_read_data(struct us_data *us, len =min (sectors, (unsigned int ) info->blocksize) * info->pagesize; buffer =kmalloc (len,GFP_NOIO );if (buffer ==NULL ) { -printk ("sddr09_read_data: Out of memory\n" ); +printk (KERN_WARNING "sddr09_read_data: Out of memory\n" );return -ENOMEM ; }
@@ -838,7 +838,8 @@ sddr09_write_lba(struct us_data *us, unsif (pba ==UNDEF ) { pba =sddr09_find_unused_pba (info, lba);if (!pba) { -printk ("sddr09_write_lba: Out of unused blocks\n" ); +printk (KERN_WARNING +"sddr09_write_lba: Out of unused blocks\n" );return -ENOSPC ; } info->pba_to_lba[pba] = lba;
@@ -849,7 +850,7 @@ sddr09_write_lba(struct us_data *us, unsif (pba ==1 ) {/* Maybe it is impossible to write to PBA 1. Fake success, but don't do anything. */ -printk ("sddr09: avoid writing to pba 1\n" ); +printk (KERN_WARNING "sddr09: avoid writing to pba 1\n" );return 0 ; }
@@ -954,7 +955,7 @@ sddr09_write_data(struct us_data *us, blocklen = (pagelen << info->blockshift); blockbuffer =kmalloc (blocklen,GFP_NOIO );if (!blockbuffer) { -printk ("sddr09_write_data: Out of memory\n" ); +printk (KERN_WARNING "sddr09_write_data: Out of memory\n" );return -ENOMEM ; }
@@ -965,7 +966,7 @@ sddr09_write_data(struct us_data *us, len =min (sectors, (unsigned int ) info->blocksize) * info->pagesize; buffer =kmalloc (len,GFP_NOIO );if (buffer ==NULL ) { -printk ("sddr09_write_data: Out of memory\n" ); +printk (KERN_WARNING "sddr09_write_data: Out of memory\n" );kfree (blockbuffer);return -ENOMEM ; }
@@ -1112,7 +1113,7 @@ sddr09_get_cardinfo(struct us_data *us,if (result) {US_DEBUGP ("Result of read_deviceID is %d\n" , result); -printk ("sddr09: could not read card info\n" ); +printk (KERN_WARNING "sddr09: could not read card info\n" );return NULL ; }
@@ -1153,7 +1154,7 @@ sddr09_get_cardinfo(struct us_data *us,sprintf (blurbtxt +strlen (blurbtxt),", WP" ); -printk ("%s\n" , blurbtxt); +printk (KERN_WARNING "%s\n" , blurbtxt);return cardinfo; }
@@ -1184,7 +1185,7 @@ sddr09_read_map(struct us_data *us) { alloc_len = (alloc_blocks <<CONTROL_SHIFT ); buffer =kmalloc (alloc_len,GFP_NOIO );if (buffer ==NULL ) { -printk ("sddr09_read_map: out of memory\n" ); +printk (KERN_WARNING "sddr09_read_map: out of memory\n" ); result =-1 ; goto done; }
@@ -1198,7 +1199,7 @@ sddr09_read_map(struct us_data *us) { info->pba_to_lba =kmalloc (numblocks*sizeof (int ),GFP_NOIO );if (info->lba_to_pba ==NULL || info->pba_to_lba ==NULL ) { -printk ("sddr09_read_map: out of memory\n" ); +printk (KERN_WARNING "sddr09_read_map: out of memory\n" ); result =-1 ; goto done; }
@@ -1238,7 +1239,8 @@ sddr09_read_map(struct us_data *us) {if (ptr[j] !=0 ) goto nonz; info->pba_to_lba[i] =UNUSABLE ; -printk ("sddr09: PBA %d has no logical mapping\n" , i); +printk (KERN_WARNING "sddr09: PBA %d has no logical mapping\n" , + i);continue ; nonz:
@@ -1251,7 +1253,8 @@ sddr09_read_map(struct us_data *us) { nonff:/* normal PBAs start with six FFs */ if (j <6 ) { - printk("sddr09: PBA %d has no logical mapping: " + printk(KERN_WARNING + "sddr09: PBA %d has no logical mapping: " "reserved area = %02X%02X%02X%02X " "data status %02X block status %02X\n", i, ptr[0], ptr[1], ptr[2], ptr[3],
@@ -1261,7 +1264,8 @@ sddr09_read_map(struct us_data *us) { }if ((ptr[6 ] >>4 ) !=0x01 ) { -printk ("sddr09: PBA %d has invalid address field " +printk (KERN_WARNING +"sddr09: PBA %d has invalid address field " "%02X%02X/%02X%02X\n" , i, ptr[6 ], ptr[7 ], ptr[11 ], ptr[12 ]); info->pba_to_lba[i] =UNUSABLE ;
@@ -1270,7 +1274,8 @@ sddr09_read_map(struct us_data *us) {/* check even parity */ if (parity[ptr[6 ] ^ ptr[7 ]]) { -printk ("sddr09: Bad parity in LBA for block %d" +printk (KERN_WARNING +"sddr09: Bad parity in LBA for block %d" " (%02X %02X)\n" , i, ptr[6 ], ptr[7 ]); info->pba_to_lba[i] =UNUSABLE ;continue ;
@@ -1289,7 +1294,8 @@ sddr09_read_map(struct us_data *us) {*/ if (lba >=1000 ) { -printk ("sddr09: Bad low LBA %d for block %d\n" , +printk (KERN_WARNING +"sddr09: Bad low LBA %d for block %d\n" , lba, i); goto possibly_erase; }
@@ -1297,7 +1303,8 @@ sddr09_read_map(struct us_data *us) { lba +=1000 *(i/0x400 );if (info->lba_to_pba[lba] !=UNDEF ) { -printk ("sddr09: LBA %d seen for PBA %d and %d\n" , +printk (KERN_WARNING +"sddr09: LBA %d seen for PBA %d and %d\n" , lba, info->lba_to_pba[lba], i); goto possibly_erase; }
drivers/usb/storage/alauda.c +16 -9
@@ -307,7 +307,8 @@ static int alauda_init_media(struct us_d data[0], data[1], data[2], data[3]); media_info =alauda_card_find_id (data[1 ]);if (media_info ==NULL ) { -printk ("alauda_init_media: Unrecognised media signature: " +printk (KERN_WARNING +"alauda_init_media: Unrecognised media signature: " "%02X %02X %02X %02X\n" , data[0 ], data[1 ], data[2 ], data[3 ]);return USB_STOR_TRANSPORT_ERROR ;
@@ -518,7 +519,8 @@ static int alauda_read_map(struct us_dat/* check even parity */ if (parity[data[6 ] ^ data[7 ]]) { -printk ("alauda_read_map: Bad parity in LBA for block %d" +printk (KERN_WARNING +"alauda_read_map: Bad parity in LBA for block %d" " (%02X %02X)\n" , i, data[6 ], data[7 ]); pba_to_lba[i] =UNUSABLE ;continue ;
@@ -538,13 +540,16 @@ static int alauda_read_map(struct us_dat*/ if (lba_offset >= uzonesize) { -printk ("alauda_read_map: Bad low LBA %d for block %d\n" , +printk (KERN_WARNING +"alauda_read_map: Bad low LBA %d for block %d\n" , lba_real, blocknum);continue ; }if (lba_to_pba[lba_offset] !=UNDEF ) { -printk ("alauda_read_map: LBA %d seen for PBA %d and %d\n" , +printk (KERN_WARNING +"alauda_read_map: " +"LBA %d seen for PBA %d and %d\n" , lba_real, lba_to_pba[lba_offset], blocknum);continue ; }
@@ -712,13 +717,15 @@ static int alauda_write_lba(struct us_daif (pba ==1 ) {/* Maybe it is impossible to write to PBA 1. Fake success, but don't do anything. */ -printk ("alauda_write_lba: avoid writing to pba 1\n" ); +printk (KERN_WARNING +"alauda_write_lba: avoid writing to pba 1\n" );return USB_STOR_TRANSPORT_GOOD ; } new_pba =alauda_find_unused_pba (&MEDIA_INFO (us), zone);if (!new_pba) { -printk ("alauda_write_lba: Out of unused blocks\n" ); +printk (KERN_WARNING +"alauda_write_lba: Out of unused blocks\n" );return USB_STOR_TRANSPORT_ERROR ; }
@@ -818,7 +825,7 @@ static int alauda_read_data(struct us_da len =min (sectors, blocksize) * (pagesize +64 ); buffer =kmalloc (len,GFP_NOIO );if (buffer ==NULL ) { -printk ("alauda_read_data: Out of memory\n" ); +printk (KERN_WARNING "alauda_read_data: Out of memory\n" );return USB_STOR_TRANSPORT_ERROR ; }
@@ -911,7 +918,7 @@ static int alauda_write_data(struct us_d len =min (sectors, blocksize) * pagesize; buffer =kmalloc (len,GFP_NOIO );if (buffer ==NULL ) { -printk ("alauda_write_data: Out of memory\n" ); +printk (KERN_WARNING "alauda_write_data: Out of memory\n" );return USB_STOR_TRANSPORT_ERROR ; }
@@ -921,7 +928,7 @@ static int alauda_write_data(struct us_d*/ blockbuffer =kmalloc ((pagesize +64 ) * blocksize,GFP_NOIO );if (blockbuffer ==NULL ) { -printk ("alauda_write_data: Out of memory\n" ); +printk (KERN_WARNING "alauda_write_data: Out of memory\n" );kfree (buffer);return USB_STOR_TRANSPORT_ERROR ; }
drivers/usb/storage/sddr55.c +3 -1
@@ -703,7 +703,9 @@ static int sddr55_read_map(struct us_datif (info->lba_to_pba[lba + zone *1000 ] !=NOT_ALLOCATED && !info->force_read_only) { -printk ("sddr55: map inconsistency at LBA %04X\n" , lba + zone *1000 ); +printk (KERN_WARNING +"sddr55: map inconsistency at LBA %04X\n" , + lba + zone *1000 ); info->force_read_only =1 ; }