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] [day] [month] [year] [list]
Date:	Mon, 23 May 2011 06:52:44 -0700
From:	Guenter Roeck <guenter.roeck@...csson.com>
To:	"Stijn Devriendt (sdevrien)" <sdevrien@...co.com>
CC:	"khali@...ux-fr.org" <khali@...ux-fr.org>,
	"lm-sensors@...sensors.org" <lm-sensors@...sensors.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [lm-sensors] [PATCH] Add support for the Philips SA56004
 temperature sensor.

On Mon, May 23, 2011 at 03:08:42AM -0400, Stijn Devriendt (sdevrien) wrote:
> > -----Original Message-----
> > From: Guenter Roeck [mailto:guenter.roeck@...csson.com]
> > 
> > >  	if (!name) { /* identification failed */
> > > @@ -1372,6 +1401,18 @@ static int lm90_probe(struct i2c_client
> > *new_client,
> > >  	/* Set maximum conversion rate */
> > >  	data->max_convrate = lm90_params[data->kind].max_convrate;
> > >
> > > +	if (data->flags & LM90_HAVE_LOCAL_EXT) {
> > > +		if (lm90_params[data->kind].local_ext_offset > 0)
> > > +			data->local_ext_offset =
> > > +
> lm90_params[data->kind].local_ext_offset;
> > > +		else {
> > > +			dev_err(&new_client->dev,
> > > +			  "Invalid temperature extension register. "
> > > +			  "Accuracy may be limited.\n");
> > > +			data->flags &= (~LM90_HAVE_LOCAL_EXT);
> > > +		}
> > 
> > Either { } in both branches of the if statement, or none.
> > ( ) around ~LM90_HAVE_LOCAL_EXT is unnecessary.
> > 
> > I see it as BUG if LM90_HAVE_LOCAL_EXT is set but local_ext_offset
> isn't.
> > That should be found during coding (or code review), and not be
> exported
> > to the user. So, from my perspective, the check is unnecessary. I'll
> leave
> > that up to Jean to decide, though.
> > 
> Do you think a BUG_ON() would be better suited here?
> 
I would just use

	data->local_ext_offset = lm90_params[data->kind].local_ext_offset;

without any conditionals (the if statements just add code without real value),
followed by

	BUG_ON((data->flags & LM90_HAVE_LOCAL_EXT) && data->local_ext_offset == 0);

if you want to be sure.

> > In addition to the above, your patch generates several checkpatch
> errors
> > (trailing whitespace). Please fix.
> I recall letting checkpatch yell at me... I'll have another round of it
> to
> be sure.
> 
Try to apply your own patch, and you'll see git complain about whitespace errors.

Thanks,
Guenter
--
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