netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: atlantic: Remove unnecessary conversion to bool
@ 2020-11-06  2:57 xiakaixu1987
  2020-11-07 23:42 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: xiakaixu1987 @ 2020-11-06  2:57 UTC (permalink / raw)
  To: irusskikh, andrew, davem; +Cc: netdev, linux-kernel, Kaixu Xia

From: Kaixu Xia <kaixuxia@tencent.com>

The '!=' expression itself is bool, no need to convert it to bool.
Fix the following coccicheck warning:

./drivers/net/ethernet/aquantia/atlantic/aq_nic.c:1477:34-39: WARNING: conversion to bool not needed here

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index bf5e0e9bd0e2..2087581b31ad 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -1474,7 +1474,7 @@ int aq_nic_setup_tc_mqprio(struct aq_nic_s *self, u32 tcs, u8 *prio_tc_map)
 		for (i = 0; i < sizeof(cfg->prio_tc_map); i++)
 			cfg->prio_tc_map[i] = cfg->tcs * i / 8;
 
-	cfg->is_qos = (tcs != 0 ? true : false);
+	cfg->is_qos = (tcs != 0);
 	cfg->is_ptp = (cfg->tcs <= AQ_HW_PTP_TC);
 	if (!cfg->is_ptp)
 		netdev_warn(self->ndev, "%s\n",
-- 
2.20.0


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

* Re: [PATCH] net: atlantic: Remove unnecessary conversion to bool
  2020-11-06  2:57 [PATCH] net: atlantic: Remove unnecessary conversion to bool xiakaixu1987
@ 2020-11-07 23:42 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2020-11-07 23:42 UTC (permalink / raw)
  To: xiakaixu1987; +Cc: irusskikh, andrew, davem, netdev, linux-kernel, Kaixu Xia

On Fri,  6 Nov 2020 10:57:59 +0800 xiakaixu1987@gmail.com wrote:
> -	cfg->is_qos = (tcs != 0 ? true : false);
> +	cfg->is_qos = (tcs != 0);

!!tcs

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

end of thread, other threads:[~2020-11-07 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-06  2:57 [PATCH] net: atlantic: Remove unnecessary conversion to bool xiakaixu1987
2020-11-07 23:42 ` Jakub Kicinski

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