public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Ashish Jangam <Ashish.Jangam@kpitcummins.com>,
	Paul Gortmaker <p_gortmaker@yahoo.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCHv1 3/11] RTC: RTC module of DA9052 PMIC driver
Date: Tue, 12 Apr 2011 17:02:16 -0700	[thread overview]
Message-ID: <1302652936.1664.13.camel@Joe-Laptop> (raw)
In-Reply-To: <20110412163743.1d7353c4.akpm@linux-foundation.org>

On Tue, 2011-04-12 at 16:37 -0700, Andrew Morton wrote:
> On Wed, 6 Apr 2011 18:47:29 +0530
> Ashish Jangam <Ashish.Jangam@kpitcummins.com> wrote:
> Please feed all the patches through scritps/checkpatch.pl if you haven't
> already done so, to clean up lots of trivial errors.
> For example, "MFD: MFD module of DA9052 PMIC driver":
> 	total: 449 errors, 832 warnings, 2326 lines checked

And a couple of more comments...

> > +static int da9052_rtc_enable_alarm(struct da9052 *da9052, unsigned char flag)
[]
> > +		if (ret != 0)
> > +			dev_err(da9052->dev, "da9052_rtc_enable_alarm -> \
> > +					da9052_clear_bits error %d\n", ret);
[]
> > +	ret = da9052_reg_read(rtc->da9052, DA9052_ALARM_MI_REG);
> > +	if (ret < 0) {
> > +		dev_err(rtc->da9052->dev, "da9052_rtc_notifier -> \
> > +					da9052_reg_read error %d\n", ret);

Line continuations in the middle a format string are very
error prone to whitespace errors, just like these introduce
bad whitespace after the ->.

These are better as:

		dev_err(rtc->da9052->dev, "%s: da9052_reg_read error: %d\n",
			__func__, ret);

Or maybe use some new macro/function(s) like

#define rtc_err(rtc, fmt, ...)	\
	dev_err((rtc)->da9052->dev, "%s: " fmt, __func__, ##__VA_ARGS__)

so these can be:

		rtc_err(rtc, "da9052_reg_read error: %d\n, ret);



  reply	other threads:[~2011-04-13  0:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-06 13:17 [PATCHv1 3/11] RTC: RTC module of DA9052 PMIC driver Ashish Jangam
2011-04-12 23:37 ` Andrew Morton
2011-04-13  0:02   ` Joe Perches [this message]
2011-04-13  0:36   ` [PATCH] checkpatch: Add check for line continuations in quoted strings Joe Perches
2011-04-14 11:39   ` [PATCHv1 3/11] RTC: RTC module of DA9052 PMIC driver Ashish Jangam
  -- strict thread matches above, loose matches on Subject: below --
2011-04-14 11:02 Ashish Jangam
2011-04-16 17:38 ` Joe Perches

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=1302652936.1664.13.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=Ashish.Jangam@kpitcummins.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p_gortmaker@yahoo.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