lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1302652936.1664.13.camel@Joe-Laptop>
Date:	Tue, 12 Apr 2011 17:02:16 -0700
From:	Joe Perches <joe@...ches.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Ashish Jangam <Ashish.Jangam@...tcummins.com>,
	Paul Gortmaker <p_gortmaker@...oo.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCHv1 3/11] RTC: RTC module of DA9052 PMIC driver

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@...tcummins.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);


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ