Skip to content

Commit b2bda2f

Browse files
petersennadavem330
authored andcommitted
bnx2x: Remove useless return variables
This patch remove variables that are initialized with a constant, are never updated, and are only used as parameter of return. Return the constant instead of using a variable. Verified by compilation only. The coccinelle script that find and fixes this issue is: // <smpl> @@ type T; constant C; identifier ret; @@ - T ret = C; ... when != ret when strict return - ret + C ; // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3afc557 commit b2bda2f

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,7 +2218,6 @@ int bnx2x_update_pfc(struct link_params *params,
22182218
*/
22192219
u32 val;
22202220
struct bnx2x *bp = params->bp;
2221-
int bnx2x_status = 0;
22222221
u8 bmac_loopback = (params->loopback_mode == LOOPBACK_BMAC);
22232222

22242223
if (params->feature_config_flags & FEATURE_CONFIG_PFC_ENABLED)
@@ -2232,7 +2231,7 @@ int bnx2x_update_pfc(struct link_params *params,
22322231
bnx2x_update_pfc_nig(params, vars, pfc_params);
22332232

22342233
if (!vars->link_up)
2235-
return bnx2x_status;
2234+
return 0;
22362235

22372236
DP(NETIF_MSG_LINK, "About to update PFC in BMAC\n");
22382237

@@ -2246,7 +2245,7 @@ int bnx2x_update_pfc(struct link_params *params,
22462245
== 0) {
22472246
DP(NETIF_MSG_LINK, "About to update PFC in EMAC\n");
22482247
bnx2x_emac_enable(params, vars, 0);
2249-
return bnx2x_status;
2248+
return 0;
22502249
}
22512250
if (CHIP_IS_E2(bp))
22522251
bnx2x_update_pfc_bmac2(params, vars, bmac_loopback);
@@ -2260,7 +2259,7 @@ int bnx2x_update_pfc(struct link_params *params,
22602259
val = 1;
22612260
REG_WR(bp, NIG_REG_BMAC0_PAUSE_OUT_EN + params->port*4, val);
22622261
}
2263-
return bnx2x_status;
2262+
return 0;
22642263
}
22652264

22662265
static int bnx2x_bmac1_enable(struct link_params *params,
@@ -6473,7 +6472,6 @@ int bnx2x_test_link(struct link_params *params, struct link_vars *vars,
64736472
static int bnx2x_link_initialize(struct link_params *params,
64746473
struct link_vars *vars)
64756474
{
6476-
int rc = 0;
64776475
u8 phy_index, non_ext_phy;
64786476
struct bnx2x *bp = params->bp;
64796477
/* In case of external phy existence, the line speed would be the
@@ -6546,7 +6544,7 @@ static int bnx2x_link_initialize(struct link_params *params,
65466544
NIG_STATUS_XGXS0_LINK_STATUS |
65476545
NIG_STATUS_SERDES0_LINK_STATUS |
65486546
NIG_MASK_MI_INT));
6549-
return rc;
6547+
return 0;
65506548
}
65516549

65526550
static void bnx2x_int_link_reset(struct bnx2x_phy *phy,

0 commit comments

Comments
 (0)