OSDN Git Service

power: supply: cpcap-charger: Simplify bool conversion
authorYang Li <yang.lee@linux.alibaba.com>
Fri, 29 Jan 2021 08:10:12 +0000 (16:10 +0800)
committerSebastian Reichel <sre@kernel.org>
Mon, 5 Apr 2021 09:37:06 +0000 (11:37 +0200)
Fix the following coccicheck warning:
./drivers/power/supply/cpcap-charger.c:416:31-36: WARNING: conversion to
bool not needed here

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/cpcap-charger.c

index 2a8915c..df01abc 100644 (file)
@@ -465,7 +465,7 @@ static bool cpcap_charger_vbus_valid(struct cpcap_charger_ddata *ddata)
 
        error = iio_read_channel_processed(channel, &value);
        if (error >= 0)
-               return value > 3900 ? true : false;
+               return value > 3900;
 
        dev_err(ddata->dev, "error reading VBUS: %i\n", error);