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: <20110216152028.GA14199@ericsson.com>
Date:	Wed, 16 Feb 2011 07:20:28 -0800
From:	Guenter Roeck <guenter.roeck@...csson.com>
To:	Clemens Ladisch <clemens@...isch.de>
CC:	Jean Delvare <khali@...ux-fr.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"lm-sensors@...sensors.org" <lm-sensors@...sensors.org>
Subject: Re: [lm-sensors] [PATCH 3/3] hwmon: (jc42) do not allow writing to
 locked registers

On Wed, Feb 16, 2011 at 10:11:35AM -0500, Clemens Ladisch wrote:
> Guenter Roeck wrote:
> > On Wed, Feb 16, 2011 at 08:02:38AM -0500, Clemens Ladisch wrote:
> > > +		readonly = config & JC42_CFG_TCRIT_LOCK;
> > 
> > You are assigning a non-bool to a bool. I can see that recent C compilers
> > do the right thing, but I am not sure if that is always the case.
> > So I would prefer
> > 		readonly = !!(config & JC42_CFG_TCRIT_LOCK);
> > 
> > Same for the assignments below. I can make that change if you are ok with it.
> 
> I cannot imagine how a compiler could get this wrong even if it tried
> to, but if you think so, go ahead.  :)
> 
I don't know. Maybe I am just paranoid. Using !! is how I usually see it done.
Is it really needed ? No idea. Better safe than sorry...

Applied with above changes.

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