Skip to contentSkip to conversation

phy: cpcap-usb: Simplify bool conversion

PATCH Applied Yang Li 2 participants 2 messages Jan 29, 2021 – Feb 6, 2021 Generic PHY framework

lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 phy: cpcap-usb: Simplify bool conversion

Fix the following coccicheck warning:
./drivers/phy/motorola/phy-cpcap-usb.c:146:31-36: WARNING: conversion to bool not needed here

---
 drivers/phy/motorola/phy-cpcap-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/motorola/phy-cpcap-usb.c +1 -1
index 4728e2b..6ee478b 100644
@@ -143,7 +143,7 @@ static bool cpcap_usb_vbus_valid(struct cpcap_phy_ddata *ddata)
 
 	error = iio_read_channel_processed(ddata->vbus, &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
maintainer Applied
#1 lore raw
Quoted 3 lines · Yang Li

Fix the following coccicheck warning:
./drivers/phy/motorola/phy-cpcap-usb.c:146:31-36: WARNING: conversion to bool not needed here

Applied, thanks

Signature · 1 line
~Vinod