linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ptp: Remove unneeded conversion to bool
@ 2020-04-20 12:34 Jason Yan
  2020-04-21 22:45 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Yan @ 2020-04-20 12:34 UTC (permalink / raw)
  To: richardcochran, netdev, linux-kernel; +Cc: Jason Yan

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>
---
 drivers/ptp/ptp_ines.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c
index dfda54cbd866..52d77db39829 100644
--- a/drivers/ptp/ptp_ines.c
+++ b/drivers/ptp/ptp_ines.c
@@ -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);
 
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ptp: Remove unneeded conversion to bool
  2020-04-20 12:34 [PATCH] ptp: Remove unneeded conversion to bool Jason Yan
@ 2020-04-21 22:45 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-04-21 22:45 UTC (permalink / raw)
  To: yanaijie; +Cc: richardcochran, netdev, linux-kernel

From: Jason Yan <yanaijie@huawei.com>
Date: Mon, 20 Apr 2020 20:34:31 +0800

> 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>

Applied to net-next.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-21 22:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 12:34 [PATCH] ptp: Remove unneeded conversion to bool Jason Yan
2020-04-21 22:45 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).