Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1601753 > unrolled thread

Re: [PATCH v2] Power: supply: sbs-charger: simplified bool function

Started bySebastian Reichel <sre@kernel.org>
First post2017-03-15 22:30 +0100
Last post2017-03-15 22:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2] Power: supply: sbs-charger: simplified bool function Sebastian Reichel <sre@kernel.org> - 2017-03-15 22:30 +0100

#1601753 — Re: [PATCH v2] Power: supply: sbs-charger: simplified bool function

FromSebastian Reichel <sre@kernel.org>
Date2017-03-15 22:30 +0100
SubjectRe: [PATCH v2] Power: supply: sbs-charger: simplified bool function
Message-ID<tloEy-50F-15@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

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
> 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web