lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 30 Dec 2020 14:10:51 +0800
From:   YANG LI <abaci-bugfix@...ux.alibaba.com>
To:     davem@...emloft.net
Cc:     kuba@...nel.org, dchickles@...vell.com, sburla@...vell.com,
        fmanlunas@...vell.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        YANG LI <abaci-bugfix@...ux.alibaba.com>
Subject: [PATCH] liquidio: style:  Identical condition and return expression 'retval', return value is always 0.

The warning was because of the following line in function
liquidio_get_fec():

retval = wait_for_sc_completion_timeout(oct, sc, 0);
    if (retval)
	return retval;

If this statement is not true, retval must be 0 and not updated
later. So, It is better to return 0 directly.

Signed-off-by: YANG LI <abaci-bugfix@...ux.alibaba.com>
Reported-by: Abaci <abaci@...ux.alibaba.com>
---
 drivers/net/ethernet/cavium/liquidio/lio_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
index 37d0641..cff18a0 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_core.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c
@@ -1811,5 +1811,5 @@ int liquidio_get_fec(struct lio *lio)
 			oct->props[lio->ifidx].fec ? "on" : "off");
 	}
 
-	return retval;
+	return 0;
 }
-- 
1.8.3.1

Powered by blists - more mailing lists