Skip to contentSkip to conversation

ptp: Remove unneeded conversion to bool

PATCH Applied Jason Yan 2 participants 2 messages Apr 20, 2020 – Apr 21, 2020

Subsystems (3)
lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 ptp: Remove unneeded conversion to bool

The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning:

drivers/ptp/ptp_ines.c:403:55-60: WARNING: conversion to bool not needed here
drivers/ptp/ptp_ines.c:404:55-60: WARNING: conversion to bool not needed here

---
 drivers/ptp/ptp_ines.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ptp/ptp_ines.c +2 -2
index dfda54cbd866..52d77db39829 100644
@@ -400,8 +400,8 @@ static int ines_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr)
 	ines_write32(port, ts_stat_rx, ts_stat_rx);
 	ines_write32(port, ts_stat_tx, ts_stat_tx);
 
-	port->rxts_enabled = ts_stat_rx == TS_ENABLE ? true : false;
-	port->txts_enabled = ts_stat_tx == TS_ENABLE ? true : false;
+	port->rxts_enabled = ts_stat_rx == TS_ENABLE;
+	port->txts_enabled = ts_stat_tx == TS_ENABLE;
 
 	spin_unlock_irqrestore(&port->lock, flags);
 
Signature · 1 line
2.21.1
maintainer Applied
#1 lore raw

From: Jason Yan <[email protected]>
Date: Mon, 20 Apr 2020 20:34:31 +0800

Quoted 9 lines

The '==' expression itself is bool, no need to convert it to bool again. This fixes the following coccicheck warning:

drivers/ptp/ptp_ines.c:403:55-60: WARNING: conversion to bool not needed here
drivers/ptp/ptp_ines.c:404:55-60: WARNING: conversion to bool not needed here

Applied to net-next.