lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180109162154.ewgp5bbuxlaesgwz@earth.universe>
Date:   Tue, 9 Jan 2018 17:21:54 +0100
From:   Sebastian Reichel <sre@...nel.org>
To:     Pavel Machek <pavel@....cz>
Cc:     pali.rohar@...il.com, kernel list <linux-kernel@...r.kernel.org>,
        linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
        linux-omap@...r.kernel.org, tony@...mide.com, khilman@...nel.org,
        aaro.koskinen@....fi, ivo.g.dimitrov.75@...il.com,
        patrikbachan@...il.com, serge@...lyn.com, abcloriens@...il.com,
        clayton@...ftyguy.net, martijn@...xit.nl,
        sakari.ailus@...ux.intel.com,
        Filip Matijević <filip.matijevic.pz@...il.com>,
        linux-pm@...r.kernel.org
Subject: Re: [PATCH] bq24190: Simplify code in property_is_writeable

Hi,

On Wed, Dec 27, 2017 at 10:20:42AM +0100, Pavel Machek wrote:
> Simplify function that should be trivial.
> 
> Signed-off-by: Pavel machek <pavel@....cz>

Thanks, queued.

-- Sebastian

> diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
> index 35ff406..4ea8f0a 100644
> --- a/drivers/power/supply/bq24190_charger.c
> +++ b/drivers/power/supply/bq24190_charger.c
> @@ -1193,8 +1193,6 @@ static int bq24190_charger_set_property(struct power_supply *psy,
>  static int bq24190_charger_property_is_writeable(struct power_supply *psy,
>  		enum power_supply_property psp)
>  {
> -	int ret;
> -
>  	switch (psp) {
>  	case POWER_SUPPLY_PROP_ONLINE:
>  	case POWER_SUPPLY_PROP_TEMP_ALERT_MAX:
> @@ -1202,13 +1200,10 @@ static int bq24190_charger_property_is_writeable(struct power_supply *psy,
>  	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
>  	case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
>  	case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT:
> -		ret = 1;
> -		break;
> +		return 1;
>  	default:
> -		ret = 0;
> +		return 0;
>  	}
> -
> -	return ret;
>  }
>  
>  static void bq24190_input_current_limit_work(struct work_struct *work)
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html



Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ