Skip to contentSkip to conversation

power: supply: Simplify bool conversion

PATCH New Yang Li 1 participant 1 message Jan 29, 2021 Power supply

lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 power: supply: Simplify bool conversion

Fix the following coccicheck warning:
./drivers/power/supply/cpcap-charger.c:416:31-36: WARNING: conversion to bool not needed here

---
 drivers/power/supply/cpcap-charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/cpcap-charger.c +1 -1
index c0d452e..c70a761 100644
@@ -413,7 +413,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);
 
Signature · 1 line
1.8.3.1