All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Grinberg <grinberg@compulab.co.il>
To: "Menon, Nishanth" <nm@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
	Mike Rapoport <mike@compulab.co.il>,
	Tim Nordell <tim.nordell@logicpd.com>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] arm: omap: gpmc-smsc911x: minor style fixes
Date: Tue, 26 Apr 2011 18:48:07 +0300	[thread overview]
Message-ID: <4DB6E937.7090904@compulab.co.il> (raw)
In-Reply-To: <BANLkTi=3eh+0zRD4jRDPoiGxMgCGeOdrww@mail.gmail.com>

On 04/26/11 17:49, Menon, Nishanth wrote:

> On Tue, Apr 26, 2011 at 09:40, Igor Grinberg <grinberg@compulab.co.il> wrote:
>> Hi Nishanth,
>>
>> On 04/26/11 16:45, Menon, Nishanth wrote:
>>
>>> On Thu, Apr 21, 2011 at 09:50, Igor Grinberg <grinberg@compulab.co.il> wrote:
>>>> replace "printk(KERN_ERR" by "pr_err("
>>>> and fix needlessly multi-lined #ifdef
>>>>
>>>> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
>>>> ---
>>>>  arch/arm/mach-omap2/gpmc-smsc911x.c             |   14 +++++++-------
>>>>  arch/arm/plat-omap/include/plat/gpmc-smsc911x.h |    3 +--
>>>>  2 files changed, 8 insertions(+), 9 deletions(-)
>>>>
>>>> diff --git a/arch/arm/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c
>>>> index d30293a..b45efff 100644
>>>> --- a/arch/arm/mach-omap2/gpmc-smsc911x.c
>>>> +++ b/arch/arm/mach-omap2/gpmc-smsc911x.c
>>> minor suggestion: wont using pr_fmt help to reduce the need to add %s,
>>> __func__ for pr_err through out the file?
>> I don't understand of what "need" are you talking about.
>> I don't know of any need to add "%s, __func__" with pr_fmt...
>> I've added "%s, __func__" as a meter of choice.
>> IMO, it makes it easier to parse the dmesg output.
>> If anyone objects it, I can remove them,
>> but I think both pr_fmt and __func__ are nice here and
>> way better then "printk(KERN_*" with embedded "smsc911x".
> Allow me to rephrase.
> I like the change of printk->pr_err - thanks for doing it. just
> suggesting a minor improvement
>
> if you add the following line before the #includes
> #define pr_fmt(fmt) "%s: " fmt, __func__
> then
> -               printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
> -                               gpmc_cfg->gpio_irq);
> +               pr_err("%s: Failed to request IRQ GPIO%d\n", __func__,
> +                      gpmc_cfg->gpio_irq);
> becomes,
> -               printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
> -                               gpmc_cfg->gpio_irq);
> +               pr_err("Failed to request IRQ GPIO%d\n", gpmc_cfg->gpio_irq);
>
> Both give you exactly the output you would like to see (which I
> personally prefer as well), but the second could be lesser lines of
> code change ;)

Ahh, now I understand, that can be useful indeed.
I'll send a v2...

Thanks

-- 
Regards,
Igor.


WARNING: multiple messages have this Message-ID (diff)
From: grinberg@compulab.co.il (Igor Grinberg)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] arm: omap: gpmc-smsc911x: minor style fixes
Date: Tue, 26 Apr 2011 18:48:07 +0300	[thread overview]
Message-ID: <4DB6E937.7090904@compulab.co.il> (raw)
In-Reply-To: <BANLkTi=3eh+0zRD4jRDPoiGxMgCGeOdrww@mail.gmail.com>

On 04/26/11 17:49, Menon, Nishanth wrote:

> On Tue, Apr 26, 2011 at 09:40, Igor Grinberg <grinberg@compulab.co.il> wrote:
>> Hi Nishanth,
>>
>> On 04/26/11 16:45, Menon, Nishanth wrote:
>>
>>> On Thu, Apr 21, 2011 at 09:50, Igor Grinberg <grinberg@compulab.co.il> wrote:
>>>> replace "printk(KERN_ERR" by "pr_err("
>>>> and fix needlessly multi-lined #ifdef
>>>>
>>>> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
>>>> ---
>>>>  arch/arm/mach-omap2/gpmc-smsc911x.c             |   14 +++++++-------
>>>>  arch/arm/plat-omap/include/plat/gpmc-smsc911x.h |    3 +--
>>>>  2 files changed, 8 insertions(+), 9 deletions(-)
>>>>
>>>> diff --git a/arch/arm/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c
>>>> index d30293a..b45efff 100644
>>>> --- a/arch/arm/mach-omap2/gpmc-smsc911x.c
>>>> +++ b/arch/arm/mach-omap2/gpmc-smsc911x.c
>>> minor suggestion: wont using pr_fmt help to reduce the need to add %s,
>>> __func__ for pr_err through out the file?
>> I don't understand of what "need" are you talking about.
>> I don't know of any need to add "%s, __func__" with pr_fmt...
>> I've added "%s, __func__" as a meter of choice.
>> IMO, it makes it easier to parse the dmesg output.
>> If anyone objects it, I can remove them,
>> but I think both pr_fmt and __func__ are nice here and
>> way better then "printk(KERN_*" with embedded "smsc911x".
> Allow me to rephrase.
> I like the change of printk->pr_err - thanks for doing it. just
> suggesting a minor improvement
>
> if you add the following line before the #includes
> #define pr_fmt(fmt) "%s: " fmt, __func__
> then
> -               printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
> -                               gpmc_cfg->gpio_irq);
> +               pr_err("%s: Failed to request IRQ GPIO%d\n", __func__,
> +                      gpmc_cfg->gpio_irq);
> becomes,
> -               printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
> -                               gpmc_cfg->gpio_irq);
> +               pr_err("Failed to request IRQ GPIO%d\n", gpmc_cfg->gpio_irq);
>
> Both give you exactly the output you would like to see (which I
> personally prefer as well), but the second could be lesser lines of
> code change ;)

Ahh, now I understand, that can be useful indeed.
I'll send a v2...

Thanks

-- 
Regards,
Igor.

  reply	other threads:[~2011-04-26 15:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 14:50 [PATCH 1/2] arm: omap: fix bug with multiple smsc911x devices Igor Grinberg
2011-04-21 14:50 ` Igor Grinberg
2011-04-21 14:50 ` [PATCH 2/2] arm: omap: gpmc-smsc911x: minor style fixes Igor Grinberg
2011-04-21 14:50   ` Igor Grinberg
2011-04-26 13:45   ` Menon, Nishanth
2011-04-26 13:45     ` Menon, Nishanth
2011-04-26 14:40     ` Igor Grinberg
2011-04-26 14:40       ` Igor Grinberg
2011-04-26 14:49       ` Menon, Nishanth
2011-04-26 14:49         ` Menon, Nishanth
2011-04-26 15:48         ` Igor Grinberg [this message]
2011-04-26 15:48           ` Igor Grinberg
2011-04-26 16:25           ` [PATCH v2 " Igor Grinberg
2011-04-26 16:25             ` Igor Grinberg
2011-04-26 21:08             ` Menon, Nishanth
2011-04-26 21:08               ` Menon, Nishanth
2011-05-03  7:42               ` Tony Lindgren
2011-05-03  7:42                 ` Tony Lindgren
2011-04-22 12:51 ` [PATCH 1/2] arm: omap: fix bug with multiple smsc911x devices Mike Rapoport
2011-04-22 12:51   ` Mike Rapoport
2011-04-24  8:27   ` [PATCH v2 " Igor Grinberg
2011-04-24  8:27     ` Igor Grinberg
2011-05-03  6:27     ` Igor Grinberg
2011-05-03  6:27       ` Igor Grinberg
2011-05-03  7:37       ` Tony Lindgren
2011-05-03  7:37         ` Tony Lindgren

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=4DB6E937.7090904@compulab.co.il \
    --to=grinberg@compulab.co.il \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mike@compulab.co.il \
    --cc=nm@ti.com \
    --cc=tim.nordell@logicpd.com \
    --cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.