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: <AANLkTi=DRHVbz3ov_gL6qyYH673WDk+1Vyw2AvjhSRxv@mail.gmail.com>
Date:	Wed, 27 Oct 2010 15:42:53 -0200
From:	Thiago Farina <tfransosi@...il.com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	Sundar Iyer <sundar.iyer@...ricsson.com>, lrg@...mlogic.co.uk,
	sameo@...ux.intel.com, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	STEricsson_nomadik_linux@...t.st.com,
	Linus Walleij <linus.walleij@...ricsson.com>,
	Bengt JONSSON <bengt.g.jonsson@...ricsson.com>
Subject: Re: [PATCH v2 1/2] regulator: add support for regulators on the
 ab8500 MFD

On Wed, Oct 27, 2010 at 3:33 PM, Mark Brown
<broonie@...nsource.wolfsonmicro.com> wrote:
> On Wed, Oct 27, 2010 at 02:25:44PM -0200, Thiago Farina wrote:
>
>> Shouldn't be this returning 1 instead of true and 0 instead false
>> (since the return type is int not bool)?
>
> There is no reason to do this, logical values are treated as 0 and 1 in
> C.  Using false and true is clear and won't cause any difference in
> code.
>
In C99 I suppose that is true and legal?

>> Maybe like this?
>> return (ret & info->mask) ? 1: 0;
>
> No, that's needlessly obfuscated.
>
Obfuscated? What you mean? It is a driver, and people reading and
writing a driver would know what it means, no?

Would be much simpler if it was just (like done in ab3100.c):

return (ret & info->mask);
--
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