public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Richard Leitner <richard.leitner@skidata.com>
Cc: David Laight <David.Laight@ACULAB.COM>,
	Felipe Balbi <balbi@ti.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv2] usb: gadget: serial: replace hardcoded ttyGS with PREFIX
Date: Mon, 30 Jun 2014 07:45:43 -0700	[thread overview]
Message-ID: <20140630144543.GA23566@kroah.com> (raw)
In-Reply-To: <20140630132327.39b9d4d2@lxbuild.skidata.net>

On Mon, Jun 30, 2014 at 01:23:27PM +0200, Richard Leitner wrote:
> Hi,
> 
> On Mon, 30 Jun 2014 09:08:01 +0000
> David Laight <David.Laight@ACULAB.COM> wrote:
> 
> > > > From: Of Richard Leitner
> > > > > Replaces all hardcoded ttyGS strings with the PREFIX macro.
> > > > > Due to the fact the strings are spread over different source files the
> > > > > PREFIX definition is moved to u_serial.h
> > > >
> > > > Lots of changes like:
> > > > > -		DBG(cdev, "acm ttyGS%d completion, err %d\n",
> > > > > -				acm->port_num, req->status);
> > > > > +		DBG(cdev, "acm %s%d completion, err %d\n",
> > > > > +				PREFIX, acm->port_num, req->status);
> > > >
> > > > I'm not sure this improves the code.
> > > 
> > > Maybe you're right, the readability of the code wouldn't be better afterwards,
> 
> but as I already mentioned IMHO if there is such a macro it should be used everywhere or nowhere...
> 	
> > 
> > Indeed it will make most attempts to grep for the error message fail.
> 
> So your thought is to carve it out completely?
> 
> Are there any other opinions/ideas on that?

Use the "proper" debug macros that the kernel provides you (i.e.
dev_dbg() and family) and then you don't need to put the string in there
at all, the kernel will do it automatically for you, in the correct
format, so that all userspace tools can properly track what is going on.

So please remove the horrid DBG() macro entirely.

thanks,

greg k-h

  reply	other threads:[~2014-06-30 14:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 11:37 [PATCH] usb: gadget: serial: replace hardcoded ttyGS with PREFIX Richard Leitner
2014-06-27 17:46 ` Greg Kroah-Hartman
2014-06-30  6:32   ` Richard Leitner
2014-06-30  8:36     ` [PATCHv2] " Richard Leitner
2014-06-30  8:41       ` David Laight
2014-06-30  8:56         ` Richard Leitner
2014-06-30  9:08           ` David Laight
2014-06-30 11:23             ` Richard Leitner
2014-06-30 14:45               ` Greg Kroah-Hartman [this message]
2014-07-01  7:31                 ` Richard Leitner
2014-07-01 15:39                   ` Richard Leitner

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=20140630144543.GA23566@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=balbi@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=richard.leitner@skidata.com \
    /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