Re: [PATCHv1 3/11] RTC: RTC module of DA9052 PMIC driver

From: Joe Perches
Date: Tue Apr 12 2011 - 20:02:22 EST


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@xxxxxxxxxxxxxxx> 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);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/