diff mbox series

[net] net: liquidio: simplify if expression

Message ID 9845cbd62721437f946035669381a9719240fc89.1668533583.git.leonro@nvidia.com (mailing list archive)
State Accepted
Commit 733d4bbf9514890eb53ebe75827bf1fb4fd25ebe
Delegated to: Netdev Maintainers
Headers show
Series [net] net: liquidio: simplify if expression | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Leon Romanovsky Nov. 15, 2022, 5:34 p.m. UTC
From: Leon Romanovsky <leonro@nvidia.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@intel.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.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(-)

Comments

Saeed Mahameed Nov. 16, 2022, 11:01 p.m. UTC | #1
On 15 Nov 19:34, Leon Romanovsky wrote:
>From: Leon Romanovsky <leonro@nvidia.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@intel.com>
>Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
>---
>The fixed patch was in net, so sending the fix to net too.
>---

I don't follow the above note, but anyway:

Reviewed-by: Saeed Mahameed <saeed@kernel.org>
Leon Romanovsky Nov. 17, 2022, 11:16 a.m. UTC | #2
On Wed, Nov 16, 2022 at 03:01:13PM -0800, Saeed Mahameed wrote:
> On 15 Nov 19:34, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@nvidia.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@intel.com>
> > Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> > ---
> > The fixed patch was in net, so sending the fix to net too.
> > ---
> 
> I don't follow the above note, but anyway:

Patch 8979f428a4af ("net: liquidio: release resources when liquidio
driver open failed") was accepted to net tree.
https://lore.kernel.org/netdev/166842061503.15162.7865291005287723428.git-patchwork-notify@kernel.org/

> 
> Reviewed-by: Saeed Mahameed <saeed@kernel.org>
>
patchwork-bot+netdevbpf@kernel.org Nov. 18, 2022, 10:30 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 15 Nov 2022 19:34:39 +0200 you wrote:
> From: Leon Romanovsky <leonro@nvidia.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
> 
> [...]

Here is the summary with links:
  - [net] net: liquidio: simplify if expression
    https://git.kernel.org/netdev/net/c/733d4bbf9514

You are awesome, thank you!
diff mbox series

Patch

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