linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Perez de Andres <danielperezdeandres@gmail.com>
To: sre@kernel.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	nicolassaenzj@gmail.com,
	Daniel Perez <danielperezdeandres@gmail.com>
Subject: [PATCH v3] Power: supply: sbs-charger: simplified bool function
Date: Fri, 17 Mar 2017 11:42:41 +0100	[thread overview]
Message-ID: <1489747361-8957-1-git-send-email-danielperezdeandres@gmail.com> (raw)

From: Daniel Perez <danielperezdeandres@gmail.com>

This patch rewrites the implementation of the regmap's readable function
sbs_readable_reg 

Signed-off-by: Daniel Perez <danielperezdeandres@gmail.com>
---
v2 -> v3:
 - v3 is needed because version history was misplaced in the patch message.
v1 -> v2:
 - given Joe Perches' comment, I've further simplified the syntax
   of the bool function, removing the ternary conditional


 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..15947db 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;
 }
 
 static bool sbs_volatile_reg(struct device *dev, unsigned int reg)
-- 
2.7.4

                 reply	other threads:[~2017-03-17 10:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1489747361-8957-1-git-send-email-danielperezdeandres@gmail.com \
    --to=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;
as well as URLs for NNTP newsgroup(s).