linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Power: supply: sbs-charger: simplified bool function
@ 2017-02-15 15:46 Daniel Perez
  2017-03-15 21:23 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Perez @ 2017-02-15 15:46 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, nicolassaenzj, Daniel Perez

v1 -> v2:
 - given Joe Perches' comment, I've further simplified the syntax
   of the bool function, removing the ternary conditional

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..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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-15 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-15 15:46 [PATCH v2] Power: supply: sbs-charger: simplified bool function Daniel Perez
2017-03-15 21:23 ` Sebastian Reichel

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).