aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-09-04 08:01:31 -0400
committerSebastian Reichel <sre@kernel.org>2014-09-16 05:01:34 -0400
commit1c42a389eaa0fddca6e6d9625e65ff62c9b90e80 (patch)
tree107f235beb7018420d2f6e4ff871991a042535ca /drivers/power
parent585b008743b5a14d93e3d506729c73978edc8da7 (diff)
power-supply: Drop useless 'if (ret.intval)' statements
There is no need to check the value of ret.intval before returning it, as we will be returning zero explicitly when ret.intval is zero. So essentially we will end up returning value of ret.intval as it is. Drop the unnecessary 'if' statements. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/power_supply_core.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 55140ebf914c..bcff7fdf733a 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -265,10 +265,8 @@ static int __power_supply_am_i_supplied(struct device *dev, void *data)
265 struct power_supply *epsy = dev_get_drvdata(dev); 265 struct power_supply *epsy = dev_get_drvdata(dev);
266 266
267 if (__power_supply_is_supplied_by(epsy, psy)) 267 if (__power_supply_is_supplied_by(epsy, psy))
268 if (!epsy->get_property(epsy, POWER_SUPPLY_PROP_ONLINE, &ret)) { 268 if (!epsy->get_property(epsy, POWER_SUPPLY_PROP_ONLINE, &ret))
269 if (ret.intval) 269 return ret.intval;
270 return ret.intval;
271 }
272 270
273 return 0; 271 return 0;
274} 272}
@@ -293,12 +291,10 @@ static int __power_supply_is_system_supplied(struct device *dev, void *data)
293 unsigned int *count = data; 291 unsigned int *count = data;
294 292
295 (*count)++; 293 (*count)++;
296 if (psy->type != POWER_SUPPLY_TYPE_BATTERY) { 294 if (psy->type != POWER_SUPPLY_TYPE_BATTERY)
297 if (psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &ret)) 295 if (!psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &ret))
298 return 0;
299 if (ret.intval)
300 return ret.intval; 296 return ret.intval;
301 } 297
302 return 0; 298 return 0;
303} 299}
304 300