[v3,09/11] usb-storage: remove single-use define for debugging
diff mbox series

Message ID 20190821114955.12788-10-maennich@google.com
State New
Headers show
Series
  • [v3,01/11] module: support reading multiple values per modinfo tag
Related show

Commit Message

Matthias Maennich Aug. 21, 2019, 11:49 a.m. UTC
USB_STORAGE was defined as "usb-storage: " and used in a single location
as argument to printk. In order to be able to use the name
'USB_STORAGE', drop the definition and use the string directly for the
printk call.

Signed-off-by: Matthias Maennich <maennich@google.com>
---
 drivers/usb/storage/debug.h    | 2 --
 drivers/usb/storage/scsiglue.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

Comments

Greg Kroah-Hartman Aug. 21, 2019, 12:37 p.m. UTC | #1
On Wed, Aug 21, 2019 at 12:49:24PM +0100, Matthias Maennich wrote:
> USB_STORAGE was defined as "usb-storage: " and used in a single location
> as argument to printk. In order to be able to use the name
> 'USB_STORAGE', drop the definition and use the string directly for the
> printk call.
> 
> Signed-off-by: Matthias Maennich <maennich@google.com>

As you know, this patch is already in the usb-next tree, and will be in
the 5.4-rc1 merge.

But, as this series will end up going through a different tree than the
usb tree, here's my reviewed-by so that it can be included with the rest
of these patches:

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thomas Gleixner Aug. 21, 2019, 1:21 p.m. UTC | #2
On Wed, 21 Aug 2019, Matthias Maennich wrote:

> USB_STORAGE was defined as "usb-storage: " and used in a single location
> as argument to printk. In order to be able to use the name
> 'USB_STORAGE', drop the definition and use the string directly for the
> printk call.
> 
> Signed-off-by: Matthias Maennich <maennich@google.com>
> ---
>  drivers/usb/storage/debug.h    | 2 --
>  drivers/usb/storage/scsiglue.c | 2 +-
>  2 files changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h
> index 6d64f342f587..16ce06039a4d 100644
> --- a/drivers/usb/storage/debug.h
> +++ b/drivers/usb/storage/debug.h
> @@ -29,8 +29,6 @@
>  
>  #include <linux/kernel.h>
>  
> -#define USB_STORAGE "usb-storage: "
> -
>  #ifdef CONFIG_USB_STORAGE_DEBUG
>  void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb);
>  void usb_stor_show_sense(const struct us_data *us, unsigned char key,
> diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> index 05b80211290d..df4de8323eff 100644
> --- a/drivers/usb/storage/scsiglue.c
> +++ b/drivers/usb/storage/scsiglue.c
> @@ -379,7 +379,7 @@ static int queuecommand_lck(struct scsi_cmnd *srb,
>  
>  	/* check for state-transition errors */
>  	if (us->srb != NULL) {
> -		printk(KERN_ERR USB_STORAGE "Error in %s: us->srb = %p\n",
> +		printk(KERN_ERR "usb-storage: Error in %s: us->srb = %p\n",
>  			__func__, us->srb);

The proper fix for this is to use pr_fmt and convert the printk to pr_err().

Thanks,

	tglx
Greg Kroah-Hartman Aug. 21, 2019, 1:32 p.m. UTC | #3
On Wed, Aug 21, 2019 at 03:21:22PM +0200, Thomas Gleixner wrote:
> On Wed, 21 Aug 2019, Matthias Maennich wrote:
> 
> > USB_STORAGE was defined as "usb-storage: " and used in a single location
> > as argument to printk. In order to be able to use the name
> > 'USB_STORAGE', drop the definition and use the string directly for the
> > printk call.
> > 
> > Signed-off-by: Matthias Maennich <maennich@google.com>
> > ---
> >  drivers/usb/storage/debug.h    | 2 --
> >  drivers/usb/storage/scsiglue.c | 2 +-
> >  2 files changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h
> > index 6d64f342f587..16ce06039a4d 100644
> > --- a/drivers/usb/storage/debug.h
> > +++ b/drivers/usb/storage/debug.h
> > @@ -29,8 +29,6 @@
> >  
> >  #include <linux/kernel.h>
> >  
> > -#define USB_STORAGE "usb-storage: "
> > -
> >  #ifdef CONFIG_USB_STORAGE_DEBUG
> >  void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb);
> >  void usb_stor_show_sense(const struct us_data *us, unsigned char key,
> > diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> > index 05b80211290d..df4de8323eff 100644
> > --- a/drivers/usb/storage/scsiglue.c
> > +++ b/drivers/usb/storage/scsiglue.c
> > @@ -379,7 +379,7 @@ static int queuecommand_lck(struct scsi_cmnd *srb,
> >  
> >  	/* check for state-transition errors */
> >  	if (us->srb != NULL) {
> > -		printk(KERN_ERR USB_STORAGE "Error in %s: us->srb = %p\n",
> > +		printk(KERN_ERR "usb-storage: Error in %s: us->srb = %p\n",
> >  			__func__, us->srb);
> 
> The proper fix for this is to use pr_fmt and convert the printk to pr_err().

Yeah, that's the correct long-term fix, I think someone already sent
that in for the usb tree, where I have taken this patch already.

thanks,

greg k-h

Patch
diff mbox series

diff --git a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h
index 6d64f342f587..16ce06039a4d 100644
--- a/drivers/usb/storage/debug.h
+++ b/drivers/usb/storage/debug.h
@@ -29,8 +29,6 @@ 
 
 #include <linux/kernel.h>
 
-#define USB_STORAGE "usb-storage: "
-
 #ifdef CONFIG_USB_STORAGE_DEBUG
 void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb);
 void usb_stor_show_sense(const struct us_data *us, unsigned char key,
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 05b80211290d..df4de8323eff 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -379,7 +379,7 @@  static int queuecommand_lck(struct scsi_cmnd *srb,
 
 	/* check for state-transition errors */
 	if (us->srb != NULL) {
-		printk(KERN_ERR USB_STORAGE "Error in %s: us->srb = %p\n",
+		printk(KERN_ERR "usb-storage: Error in %s: us->srb = %p\n",
 			__func__, us->srb);
 		return SCSI_MLQUEUE_HOST_BUSY;
 	}