[v3,03/10] net/atlantic: extra checks for error codes

Message ID 9878dd7a3e0652025e6cdb4c9e2b6e889e2e33e9.1552402263.git.igor.russkikh@aquantia.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/atlantic: bugfixes and code cleanup |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Igor Russkikh March 12, 2019, 3:24 p.m. UTC
  Found by Coverity scan. Checks are useless
because at these code places err is always zero.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
---
 drivers/net/atlantic/hw_atl/hw_atl_utils.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Comments

Ferruh Yigit March 20, 2019, 1:24 p.m. UTC | #1
On 3/12/2019 3:24 PM, Igor Russkikh wrote:
> Found by Coverity scan. Checks are useless
> because at these code places err is always zero.

Can you please add Coverity issue number, I can squash it later.

> 
> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
> ---

<...>
  
Igor Russkikh March 20, 2019, 2:04 p.m. UTC | #2
Hi Ferruh,

Sorry forgot that.

Coverity issue: 187034

On 20.03.2019 16:24, Ferruh Yigit wrote:
> On 3/12/2019 3:24 PM, Igor Russkikh wrote:
>> Found by Coverity scan. Checks are useless
>> because at these code places err is always zero.
> 
> Can you please add Coverity issue number, I can squash it later.
> 
>>
>> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
>> ---
> 
> <...>
>
  

Patch

diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/atlantic/hw_atl/hw_atl_utils.c
index f11093a50404..13f02b9f99c5 100644
--- a/drivers/net/atlantic/hw_atl/hw_atl_utils.c
+++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.c
@@ -462,8 +462,6 @@  int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self,
 				goto err_exit;
 		}
 	} while (sw.tid != fw.tid || 0xFFFFU == fw.len);
-	if (err < 0)
-		goto err_exit;
 
 	if (rpc) {
 		if (fw.len) {
@@ -875,8 +873,7 @@  static int aq_fw1x_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac)
 	}
 
 	err = hw_atl_utils_fw_rpc_call(self, rpc_size);
-	if (err < 0)
-		goto err_exit;
+
 err_exit:
 	return err;
 }