From: Joe Perches <joe@perches.com>
To: Daniel Perez <danielperezdeandres@gmail.com>, sre@kernel.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
nicolassaenzj@gmail.com
Subject: Re: [PATCH] Power: Supply: sbs-charger: simplfied bool function
Date: Tue, 14 Feb 2017 05:58:02 -0800 [thread overview]
Message-ID: <1487080682.6214.25.camel@perches.com> (raw)
In-Reply-To: <1487079790-724-1-git-send-email-danielperezdeandres@gmail.com>
On Tue, 2017-02-14 at 14:43 +0100, Daniel Perez wrote:
> Simplified the syntax of a simple bool return value function.
>
> Signed-off-by: Daniel Perez <danielperezdeandres@gmail.com>
> ---
> drivers/power/supply/sbs-charger.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/power/supply/sbs-charger.c b/drivers/power/supply/sbs-charger.c
> index 353765a..3e40553 100644
> --- a/drivers/power/supply/sbs-charger.c
> +++ b/drivers/power/supply/sbs-charger.c
> @@ -137,10 +137,7 @@ static enum power_supply_property sbs_properties[] = {
>
> static bool sbs_readable_reg(struct device *dev, unsigned int reg)
> {
> - if (reg < SBS_CHARGER_REG_SPEC_INFO)
> - return false;
> - else
> - return true;
> + return reg < SBS_CHARGER_REG_SPEC_INFO ? false : true;
Any ternary with true false could be simplified.
Why not just
return reg >= SBS_CHARGER_REG_SPEC_INFO;
prev parent reply other threads:[~2017-02-14 13:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 13:43 Daniel Perez
2017-02-14 13:58 ` Joe Perches [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=1487080682.6214.25.camel@perches.com \
--to=joe@perches.com \
--cc=danielperezdeandres@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=nicolassaenzj@gmail.com \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®