linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Alex Courbot <acourbot@nvidia.com>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH v2 2/5] gpiolib: introduce chip_* to print with chip->label prefix
Date: Thu, 05 Dec 2013 11:09:30 +0200	[thread overview]
Message-ID: <1386234570.1871.64.camel@smile> (raw)
In-Reply-To: <529FE34F.3040704@nvidia.com>

On Thu, 2013-12-05 at 11:22 +0900, Alex Courbot wrote:
> On 12/04/2013 10:42 PM, Andy Shevchenko wrote:
> > In several places we are printing messages with prefix based on chip->label.
> > Introduced macros help us to do this easier and in uniform way.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
> > ---
> >   drivers/gpio/gpiolib.c | 41 ++++++++++++++++++++++++++---------------
> >   1 file changed, 26 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> > index 7cf3f84..70e560c 100644
> > --- a/drivers/gpio/gpiolib.c
> > +++ b/drivers/gpio/gpiolib.c
> > @@ -85,6 +85,8 @@ static DEFINE_IDR(dirent_idr);
> >   static int gpiod_request(struct gpio_desc *desc, const char *label);
> >   static void gpiod_free(struct gpio_desc *desc);
> >
> > +/* With descriptor prefix */
> > +
> >   #ifdef CONFIG_DEBUG_FS
> >   #define gpiod_emerg(desc, fmt, ...)					       \
> >   	pr_emerg("gpio-%d (%s): " fmt, desc_to_gpio(desc), desc->label ? : "?",\
> > @@ -119,6 +121,21 @@ static void gpiod_free(struct gpio_desc *desc);
> >   	pr_debug("gpio-%d: " fmt, desc_to_gpio(desc), ##__VA_ARGS__)
> >   #endif
> >
> > +/* With chip prefix */
> > +
> > +#define chip_emerg(chip, fmt, ...)					\
> > +	pr_emerg("%s: GPIO chip: " fmt, chip->label, ##__VA_ARGS__)
> > +#define chip_crit(chip, fmt, ...)					\
> > +	pr_crit("%s: GPIO chip: " fmt, chip->label, ##__VA_ARGS__)
> > +#define chip_err(chip, fmt, ...)					\
> > +	pr_err("%s: GPIO chip: " fmt, chip->label, ##__VA_ARGS__)
> > +#define chip_warn(chip, fmt, ...)					\
> > +	pr_warn("%s: GPIO chip: " fmt, chip->label, ##__VA_ARGS__)
> > +#define chip_info(chip, fmt, ...)					\
> > +	pr_info("%s: GPIO chip: " fmt, chip->label, ##__VA_ARGS__)
> > +#define chip_dbg(chip, fmt, ...)					\
> > +	pr_debug("%s: GPIO chip: " fmt, chip->label, ##__VA_ARGS__)
> 
> One last comment on this: how about using "GPIO chip %s: " for message 
> prefix instead? (less ':' and less characters overall).

Agree. Will change this one.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy


  reply	other threads:[~2013-12-05  9:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04 13:42 [PATCH v2 0/5] gpiolib: clean up and potential bug fix Andy Shevchenko
2013-12-04 13:42 ` [PATCH v2 1/5] gpiolib: unify pr_* messages format Andy Shevchenko
2013-12-04 13:42 ` [PATCH v2 2/5] gpiolib: introduce chip_* to print with chip->label prefix Andy Shevchenko
2013-12-05  2:22   ` Alex Courbot
2013-12-05  9:09     ` Andy Shevchenko [this message]
2013-12-04 13:42 ` [PATCH v2 3/5] gpiolib: convert gpiod_lookup description to kernel-doc Andy Shevchenko
2013-12-04 13:42 ` [PATCH v2 4/5] gpiolib: update commentary at gpiod_get_index() Andy Shevchenko
2013-12-05  2:10   ` Alex Courbot
2013-12-05  9:11     ` Andy Shevchenko
2013-12-04 13:43 ` [PATCH v2 5/5] gpiolib: uniform messages in gpiod_find() Andy Shevchenko
2013-12-05  2:19   ` Alex Courbot
2013-12-05  9:13     ` Andy Shevchenko
2013-12-04 15:18 ` [PATCH v2 0/5] gpiolib: clean up and potential bug fix Mika Westerberg

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=1386234570.1871.64.camel@smile \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=acourbot@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.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;
as well as URLs for NNTP newsgroup(s).