[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <9845cbd62721437f946035669381a9719240fc89.1668533583.git.leonro@nvidia.com>
Date: Tue, 15 Nov 2022 19:34:39 +0200
From: Leon Romanovsky <leon@...nel.org>
To: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: Leon Romanovsky <leonro@...dia.com>,
Derek Chickles <dchickles@...vell.com>,
Eric Dumazet <edumazet@...gle.com>,
Felix Manlunas <fmanlunas@...vell.com>,
kernel test robot <lkp@...el.com>, netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>,
Satanand Burla <sburla@...vell.com>,
Zhengchao Shao <shaozhengchao@...wei.com>
Subject: [PATCH net] net: liquidio: simplify if expression
From: Leon Romanovsky <leonro@...dia.com>
Fix the warning reported by kbuild:
cocci warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/cavium/liquidio/lio_main.c:1797:54-56: WARNING !A || A && B is equivalent to !A || B
drivers/net/ethernet/cavium/liquidio/lio_main.c:1827:54-56: WARNING !A || A && B is equivalent to !A || B
Fixes: 8979f428a4af ("net: liquidio: release resources when liquidio driver open failed")
Reported-by: kernel test robot <lkp@...el.com>
Signed-off-by: Leon Romanovsky <leonro@...dia.com>
---
The fixed patch was in net, so sending the fix to net too.
---
drivers/net/ethernet/cavium/liquidio/lio_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index 75771825c3f9..98793b2ac2c7 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -1794,7 +1794,7 @@ static int liquidio_open(struct net_device *netdev)
ifstate_set(lio, LIO_IFSTATE_RUNNING);
- if (!OCTEON_CN23XX_PF(oct) || (OCTEON_CN23XX_PF(oct) && !oct->msix_on)) {
+ if (!OCTEON_CN23XX_PF(oct) || !oct->msix_on) {
ret = setup_tx_poll_fn(netdev);
if (ret)
goto err_poll;
@@ -1824,7 +1824,7 @@ static int liquidio_open(struct net_device *netdev)
return 0;
err_rx_ctrl:
- if (!OCTEON_CN23XX_PF(oct) || (OCTEON_CN23XX_PF(oct) && !oct->msix_on))
+ if (!OCTEON_CN23XX_PF(oct) || !oct->msix_on)
cleanup_tx_poll_fn(netdev);
err_poll:
if (lio->ptp_clock) {
--
2.38.1
Powered by blists - more mailing lists