mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb <linux-usb@vger.kernel.org>,
	usb-storage <usb-storage@lists.one-eyed-alien.net>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: storage: Add usb_stor_dbg, reduce object size
Date: Wed, 17 Apr 2013 17:18:39 -0700	[thread overview]
Message-ID: <1366244319.28609.57.camel@joe-AO722> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1304171426460.1623-100000@iolanthe.rowland.org>

On Wed, 2013-04-17 at 14:47 -0400, Alan Stern wrote:
> On Wed, 17 Apr 2013, Joe Perches wrote:
[]
> > +int usb_stor_dbg(const struct us_data *us, const char *fmt, ...)
> > +{
> > +     struct va_format vaf;
> > +     va_list args;
> > +     int r;
> > +
> > +     va_start(args, fmt);
> > +
> > +     if (us && us->pusb_dev) {
> > +             r = dev_vprintk_emit(7, &us->pusb_dev->dev, fmt, args);
> 
> Isn't there a symbolic constant you can use instead of "7"?

Nope.
lib/dynamic_debug:__dynamic_dev_dbg() does the same thing.

> > --- a/drivers/usb/storage/scsiglue.c
> > +++ b/drivers/usb/storage/scsiglue.c
> 
> > @@ -349,8 +347,6 @@ static int command_abort(struct scsi_cmnd *srb)
[]
> > -     US_DEBUGP("%s called\n", __func__);
[]
> > @@ -386,8 +382,6 @@ static int device_reset(struct scsi_cmnd *srb)
[]
> > -     US_DEBUGP("%s called\n", __func__);
[]
> > @@ -402,7 +396,6 @@ static int bus_reset(struct scsi_cmnd *srb)
[]
> > -     US_DEBUGP("%s called\n", __func__);

> These three functions get called only in unusual circumstances, and for
> debugging we do want to know when they get called.  So these statements
> should remain.

I'll put 'em back and resubmit the whole schmear against
what Greg has in his tree now later.  I do think that
the function tracer does all that though and more.

Look at Documentation/trace/ftrace.txt

> > --- a/drivers/usb/storage/usb.c
[]
> > @@ -918,7 +902,7 @@ int usb_stor_probe1(struct us_data **pus,
[]
> > -     US_DEBUGP("USB Mass Storage device detected\n");
> > +     usb_stor_dbg(NULL, "USB Mass Storage device detected\n");
[]
> Even though "us" isn't available here, intf is.  This line can be a
> regular dev_dbg(&intf->dev, ...).  Or even dev_info(&intf->dev, ...);  
> this looks like the sort of thing one sees all the time in kernel logs.

I'll make it dev_info

> > @@ -1075,9 +1058,8 @@ static int storage_probe(struct usb_interface *intf,
[]
> > +             usb_stor_dbg(us, "Use Bulk-Only transport with the Transparent SCSI protocol for dynamic id: 0x%04x 0x%04x\n",
> > +                          id->idVendor, id->idProduct);

> And here "us" hasn't been set yet (it gets set in usb_stor_probe1), so
> it shouldn't be used.  This can become another dev_dbg(&intf->dev, ...)
> line.

OK.



  reply	other threads:[~2013-04-18  0:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-17  5:44 Joe Perches
2013-04-17 14:14 ` Alan Stern
2013-04-17 14:39   ` Joe Perches
2013-04-17 15:06     ` Alan Stern
2013-04-17 17:17       ` Joe Perches
2013-04-17 18:47         ` Alan Stern
2013-04-18  0:18           ` Joe Perches [this message]
2013-04-18 14:57             ` Alan Stern
2013-04-18 16:11               ` Joe Perches
2013-04-18  3:00           ` [PATCH] usb: storage: Convert US_DEBUGP to usb_stor_dbg Joe Perches
2013-04-19 17:35             ` Greg Kroah-Hartman
2013-04-19 17:44               ` Joe Perches
2013-04-19 18:44               ` [PATCH V2] " Joe Perches
2013-04-22 19:35                 ` David Rientjes
2013-04-25 22:32                   ` Andrew Morton
2013-04-26  8:59                     ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366244319.28609.57.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mdharm-usb@one-eyed-alien.net \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®