* [PATCH] e1000: remove unneeded conversion to bool
@ 2020-04-20 12:35 ` Jason Yan
0 siblings, 0 replies; 4+ messages in thread
From: Jason Yan @ 2020-04-20 12:35 UTC (permalink / raw
To: jeffrey.t.kirsher, davem, intel-wired-lan, 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/net/ethernet/intel/e1000/e1000_main.c:1479:44-49: WARNING:
conversion to bool not needed here
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index ac5146d53c4c..05bc6e216bca 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1476,7 +1476,7 @@ static bool e1000_check_64k_bound(struct e1000_adapter *adapter, void *start,
if (hw->mac_type == e1000_82545 ||
hw->mac_type == e1000_ce4100 ||
hw->mac_type == e1000_82546) {
- return ((begin ^ (end - 1)) >> 16) != 0 ? false : true;
+ return ((begin ^ (end - 1)) >> 16) == 0;
}
return true;
--
2.21.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Intel-wired-lan] [PATCH] e1000: remove unneeded conversion to bool
@ 2020-04-20 12:35 ` Jason Yan
0 siblings, 0 replies; 4+ messages in thread
From: Jason Yan @ 2020-04-20 12:35 UTC (permalink / raw
To: intel-wired-lan
The '==' expression itself is bool, no need to convert it to bool again.
This fixes the following coccicheck warning:
drivers/net/ethernet/intel/e1000/e1000_main.c:1479:44-49: WARNING:
conversion to bool not needed here
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index ac5146d53c4c..05bc6e216bca 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1476,7 +1476,7 @@ static bool e1000_check_64k_bound(struct e1000_adapter *adapter, void *start,
if (hw->mac_type == e1000_82545 ||
hw->mac_type == e1000_ce4100 ||
hw->mac_type == e1000_82546) {
- return ((begin ^ (end - 1)) >> 16) != 0 ? false : true;
+ return ((begin ^ (end - 1)) >> 16) == 0;
}
return true;
--
2.21.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] e1000: remove unneeded conversion to bool
2020-04-20 12:35 ` [Intel-wired-lan] " Jason Yan
@ 2020-04-21 22:46 ` David Miller
-1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-04-21 22:46 UTC (permalink / raw
To: yanaijie; +Cc: jeffrey.t.kirsher, intel-wired-lan, netdev, linux-kernel
From: Jason Yan <yanaijie@huawei.com>
Date: Mon, 20 Apr 2020 20:35:06 +0800
> The '==' expression itself is bool, no need to convert it to bool again.
> This fixes the following coccicheck warning:
>
> drivers/net/ethernet/intel/e1000/e1000_main.c:1479:44-49: WARNING:
> conversion to bool not needed here
>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
Applied to net-next.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Intel-wired-lan] [PATCH] e1000: remove unneeded conversion to bool
@ 2020-04-21 22:46 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-04-21 22:46 UTC (permalink / raw
To: intel-wired-lan
From: Jason Yan <yanaijie@huawei.com>
Date: Mon, 20 Apr 2020 20:35:06 +0800
> The '==' expression itself is bool, no need to convert it to bool again.
> This fixes the following coccicheck warning:
>
> drivers/net/ethernet/intel/e1000/e1000_main.c:1479:44-49: WARNING:
> conversion to bool not needed here
>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>
Applied to net-next.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-21 22:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-20 12:35 [PATCH] e1000: remove unneeded conversion to bool Jason Yan
2020-04-20 12:35 ` [Intel-wired-lan] " Jason Yan
2020-04-21 22:46 ` David Miller
2020-04-21 22:46 ` [Intel-wired-lan] " David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.