From: broonie@opensource•wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v2 1/2] regulator: add support for regulators on the ab8500 MFD
Date: Wed, 27 Oct 2010 10:56:21 -0700 [thread overview]
Message-ID: <20101027175620.GB25134@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <AANLkTi=DRHVbz3ov_gL6qyYH673WDk+1Vyw2AvjhSRxv@mail.gmail.com>
On Wed, Oct 27, 2010 at 03:42:53PM -0200, Thiago Farina wrote:
> On Wed, Oct 27, 2010 at 3:33 PM, Mark Brown
> > 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?
Yes. C has always used 1 and 0 as the numerical mappings for logical
values, the addition of the keywords did not change them.
> >> 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?
Adding the ternery operator just makes the code more noisy for no
benefit.
> Would be much simpler if it was just (like done in ab3100.c):
> return (ret & info->mask);
Yes, though there's no problem with the current code either.
prev parent reply other threads:[~2010-10-27 17:56 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-13 14:09 [PATCH v2 1/2] regulator: add support for regulators on the ab8500 MFD Sundar Iyer
2010-07-13 14:09 ` [PATCH v2 2/2] ux500: add ab8500-regulators machine specific data Sundar Iyer
2010-07-13 14:18 ` Mark Brown
2010-07-13 14:41 ` Sundar R IYER
2010-07-13 14:56 ` Mark Brown
2010-07-13 15:08 ` Sundar R IYER
2010-07-13 15:09 ` Mark Brown
2010-07-13 16:13 ` Sundar R IYER
2010-07-13 20:38 ` Mark Brown
2010-07-14 14:50 ` Sundar R IYER
2010-07-14 14:57 ` Mark Brown
2010-07-14 15:36 ` Sundar R IYER
2010-07-14 15:47 ` Mark Brown
2010-07-14 16:09 ` Sundar R IYER
2010-07-14 16:20 ` Mark Brown
2010-07-14 16:47 ` Sundar R IYER
2010-07-14 17:03 ` Mark Brown
2010-07-14 17:36 ` Sundar R IYER
2010-07-14 18:42 ` Mark Brown
2010-07-14 22:51 ` Linus Walleij
2010-07-15 9:09 ` Mark Brown
2010-07-13 14:17 ` [PATCH v2 1/2] regulator: add support for regulators on the ab8500 MFD Mark Brown
2010-07-13 14:34 ` Sundar R IYER
2010-07-13 14:57 ` Mark Brown
2010-07-13 14:58 ` Mark Brown
2010-07-13 15:11 ` Sundar R IYER
2010-07-13 15:12 ` Mark Brown
2010-07-13 16:18 ` Sundar R IYER
2010-07-13 20:40 ` Mark Brown
2010-07-15 10:29 ` Liam Girdwood
2010-10-27 16:25 ` Thiago Farina
2010-10-27 17:33 ` Mark Brown
2010-10-27 17:42 ` Thiago Farina
2010-10-27 17:56 ` Mark Brown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101027175620.GB25134@opensource.wolfsonmicro.com \
--to=broonie@opensource$(echo .)wolfsonmicro.com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox