Skip to content

Commit f6d9b51

Browse files
petersennadavem330
authored andcommitted
vxge: 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 b2bda2f commit f6d9b51

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

‎drivers/net/ethernet/neterion/vxge/vxge-config.c‎

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis)
120120
{
121121
u64 val64;
122122
u32 i = 0;
123-
enum vxge_hw_status ret = VXGE_HW_FAIL;
124123

125124
udelay(10);
126125

@@ -139,7 +138,7 @@ __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis)
139138
mdelay(1);
140139
} while (++i <= max_millis);
141140

142-
return ret;
141+
return VXGE_HW_FAIL;
143142
}
144143

145144
static inline enum vxge_hw_status
@@ -1682,12 +1681,10 @@ enum vxge_hw_status vxge_hw_driver_stats_get(
16821681
struct __vxge_hw_device *hldev,
16831682
struct vxge_hw_device_stats_sw_info *sw_stats)
16841683
{
1685-
enum vxge_hw_status status = VXGE_HW_OK;
1686-
16871684
memcpy(sw_stats, &hldev->stats.sw_dev_info_stats,
16881685
sizeof(struct vxge_hw_device_stats_sw_info));
16891686

1690-
return status;
1687+
return VXGE_HW_OK;
16911688
}
16921689

16931690
/*
@@ -3228,7 +3225,6 @@ enum vxge_hw_status
32283225
vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask)
32293226
{
32303227
struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg;
3231-
enum vxge_hw_status status = VXGE_HW_OK;
32323228
int i = 0, j = 0;
32333229

32343230
for (i = 0; i < VXGE_HW_MAX_VIRTUAL_PATHS; i++) {
@@ -3241,7 +3237,7 @@ vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask)
32413237
return VXGE_HW_FAIL;
32423238
}
32433239
}
3244-
return status;
3240+
return VXGE_HW_OK;
32453241
}
32463242
/*
32473243
* vxge_hw_mgmt_reg_Write - Write Titan register.
@@ -3979,7 +3975,6 @@ __vxge_hw_vpath_mgmt_read(
39793975
{
39803976
u32 i, mtu = 0, max_pyld = 0;
39813977
u64 val64;
3982-
enum vxge_hw_status status = VXGE_HW_OK;
39833978

39843979
for (i = 0; i < VXGE_HW_MAC_MAX_MAC_PORT_ID; i++) {
39853980

@@ -4009,7 +4004,7 @@ __vxge_hw_vpath_mgmt_read(
40094004
else
40104005
VXGE_HW_DEVICE_LINK_STATE_SET(vpath->hldev, VXGE_HW_LINK_DOWN);
40114006

4012-
return status;
4007+
return VXGE_HW_OK;
40134008
}
40144009

40154010
/*
@@ -4039,14 +4034,13 @@ static enum vxge_hw_status
40394034
__vxge_hw_vpath_reset(struct __vxge_hw_device *hldev, u32 vp_id)
40404035
{
40414036
u64 val64;
4042-
enum vxge_hw_status status = VXGE_HW_OK;
40434037

40444038
val64 = VXGE_HW_CMN_RSTHDLR_CFG0_SW_RESET_VPATH(1 << (16 - vp_id));
40454039

40464040
__vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(val64, 0, 32),
40474041
&hldev->common_reg->cmn_rsthdlr_cfg0);
40484042

4049-
return status;
4043+
return VXGE_HW_OK;
40504044
}
40514045

40524046
/*
@@ -4227,7 +4221,6 @@ static enum vxge_hw_status
42274221
__vxge_hw_vpath_mac_configure(struct __vxge_hw_device *hldev, u32 vp_id)
42284222
{
42294223
u64 val64;
4230-
enum vxge_hw_status status = VXGE_HW_OK;
42314224
struct __vxge_hw_virtualpath *vpath;
42324225
struct vxge_hw_vp_config *vp_config;
42334226
struct vxge_hw_vpath_reg __iomem *vp_reg;
@@ -4283,7 +4276,7 @@ __vxge_hw_vpath_mac_configure(struct __vxge_hw_device *hldev, u32 vp_id)
42834276

42844277
writeq(val64, &vp_reg->rxmac_vcfg1);
42854278
}
4286-
return status;
4279+
return VXGE_HW_OK;
42874280
}
42884281

42894282
/*
@@ -4295,7 +4288,6 @@ static enum vxge_hw_status
42954288
__vxge_hw_vpath_tim_configure(struct __vxge_hw_device *hldev, u32 vp_id)
42964289
{
42974290
u64 val64;
4298-
enum vxge_hw_status status = VXGE_HW_OK;
42994291
struct __vxge_hw_virtualpath *vpath;
43004292
struct vxge_hw_vpath_reg __iomem *vp_reg;
43014293
struct vxge_hw_vp_config *config;
@@ -4545,7 +4537,7 @@ __vxge_hw_vpath_tim_configure(struct __vxge_hw_device *hldev, u32 vp_id)
45454537
val64 |= VXGE_HW_TIM_WRKLD_CLC_CNT_RX_TX(3);
45464538
writeq(val64, &vp_reg->tim_wrkld_clc);
45474539

4548-
return status;
4540+
return VXGE_HW_OK;
45494541
}
45504542

45514543
/*

0 commit comments

Comments
 (0)