bq24190: Simplify code in property_is_writeable
PATCH 1/1 bq24190: Simplify code in property_is_writeable
Simplify function that should be trivial.
Signed-off-by Pavel machek <[email protected]>
drivers/power/supply/bq24190_charger.c +2 -7
@@ -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)
Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171227/b4e3f407/attachment-0001.sig>
Sebastian Reichel
maintainerHi,
Quoted 3 lines · Pavel Machek
Simplify function that should be trivial.
Signed-off-by Pavel machek <[email protected]>
Thanks, queued.
-- Sebastian
Quoted 33 lines
drivers/power/supply/bq24190_charger.c +2
-7@@ -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)Signature · 3 lines
-- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180109/f02378f1/attachment.sig>