]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ptp: Remove unneeded conversion to bool
authorJason Yan <yanaijie@huawei.com>
Mon, 20 Apr 2020 12:34:31 +0000 (20:34 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Apr 2020 22:45:32 +0000 (15:45 -0700)
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

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ptp/ptp_ines.c

index dfda54cbd86638b18c229b0ea1dcde3bc4b7cda6..52d77db39829295c614434b4a6d64934905c7aa0 100644 (file)
@@ -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);