All of lore.kernel.org
 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

* Re: [PATCH v2] Power: supply: sbs-charger: simplified bool function
  2017-02-15 15:46 [PATCH v2] Power: supply: sbs-charger: simplified bool function Daniel Perez
@ 2017-03-15 21:23 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2017-03-15 21:23 UTC (permalink / raw)
  To: Daniel Perez; +Cc: linux-pm, linux-kernel, nicolassaenzj

[-- Attachment #1: Type: text/plain, Size: 1159 bytes --]

Hi Daniel,

On Wed, Feb 15, 2017 at 04:46:21PM +0100, Daniel Perez wrote:
> 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>

Thanks, queued. Please move the Version history below ---, so that
it does not end up in the commit. I fixed that while applying.

-- Sebastian

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.