Skip to content

Commit 83aeb93

Browse files
Yuval Mintzdavem330
authored andcommitted
qed*: Trivial modifications
Change qed* code in trivial manner; This isn't necessarily semantic-only, but the end result is the same, i.e., no change should occur from user perspective. Changes include: - Using temporary variables to better fit 80-character restrictions. - Removal of unused variables & code with no effect. [plus some additional minor modifications]. Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1a635e4 commit 83aeb93

6 files changed

Lines changed: 28 additions & 46 deletions

File tree

‎drivers/net/ethernet/qlogic/qed/qed_dev.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
540540
cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL);
541541
if (!cdev->reset_stats) {
542542
DP_NOTICE(cdev, "Failed to allocate reset statistics\n");
543-
rc = -ENOMEM;
544-
goto alloc_err;
543+
goto alloc_no_mem;
545544
}
546545

547546
return 0;
@@ -1463,11 +1462,11 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
14631462
link_temp = qed_rd(p_hwfn, p_ptt,
14641463
port_cfg_addr +
14651464
offsetof(struct nvm_cfg1_port, speed_cap_mask));
1466-
link->speed.advertised_speeds =
1467-
link_temp & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_MASK;
1465+
link_temp &= NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_MASK;
1466+
link->speed.advertised_speeds = link_temp;
14681467

1469-
p_hwfn->mcp_info->link_capabilities.speed_capabilities =
1470-
link->speed.advertised_speeds;
1468+
link_temp = link->speed.advertised_speeds;
1469+
p_hwfn->mcp_info->link_capabilities.speed_capabilities = link_temp;
14711470

14721471
link_temp = qed_rd(p_hwfn, p_ptt,
14731472
port_cfg_addr +

‎drivers/net/ethernet/qlogic/qed/qed_init_ops.c‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,15 @@ static int qed_init_cmd_wr(struct qed_hwfn *p_hwfn,
295295

296296
switch (GET_FIELD(data, INIT_WRITE_OP_SOURCE)) {
297297
case INIT_SRC_INLINE:
298-
qed_wr(p_hwfn, p_ptt, addr,
299-
le32_to_cpu(arg->inline_val));
298+
data = le32_to_cpu(p_cmd->args.inline_val);
299+
qed_wr(p_hwfn, p_ptt, addr, data);
300300
break;
301301
case INIT_SRC_ZEROS:
302-
if (b_must_dmae ||
303-
(b_can_dmae && (le32_to_cpu(arg->zeros_count) >= 64)))
304-
rc = qed_init_fill_dmae(p_hwfn, p_ptt, addr, 0,
305-
le32_to_cpu(arg->zeros_count));
302+
data = le32_to_cpu(p_cmd->args.zeros_count);
303+
if (b_must_dmae || (b_can_dmae && (data >= 64)))
304+
rc = qed_init_fill_dmae(p_hwfn, p_ptt, addr, 0, data);
306305
else
307-
qed_init_fill(p_hwfn, p_ptt, addr, 0,
308-
le32_to_cpu(arg->zeros_count));
306+
qed_init_fill(p_hwfn, p_ptt, addr, 0, data);
309307
break;
310308
case INIT_SRC_ARRAY:
311309
rc = qed_init_cmd_array(p_hwfn, p_ptt, p_cmd,

‎drivers/net/ethernet/qlogic/qed/qed_int.c‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2413,12 +2413,6 @@ void qed_init_cau_sb_entry(struct qed_hwfn *p_hwfn,
24132413
SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_SB_TIMESET0, 0x7F);
24142414
SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_SB_TIMESET1, 0x7F);
24152415

2416-
/* setting the time resultion to a fixed value ( = 1) */
2417-
SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_TIMER_RES0,
2418-
QED_CAU_DEF_RX_TIMER_RES);
2419-
SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_TIMER_RES1,
2420-
QED_CAU_DEF_TX_TIMER_RES);
2421-
24222416
cau_state = CAU_HC_DISABLE_STATE;
24232417

24242418
if (cdev->int_coalescing_mode == QED_COAL_MODE_ENABLE) {
@@ -3133,10 +3127,9 @@ int qed_int_alloc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
31333127
return rc;
31343128
}
31353129
rc = qed_int_sb_attn_alloc(p_hwfn, p_ptt);
3136-
if (rc) {
3130+
if (rc)
31373131
DP_ERR(p_hwfn->cdev, "Failed to allocate sb attn mem\n");
3138-
return rc;
3139-
}
3132+
31403133
return rc;
31413134
}
31423135

‎drivers/net/ethernet/qlogic/qed/qed_l2.c‎

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,14 @@ qed_sp_update_mcast_bin(struct qed_hwfn *p_hwfn,
305305
memset(&p_ramrod->approx_mcast.bins, 0,
306306
sizeof(p_ramrod->approx_mcast.bins));
307307

308-
if (p_params->update_approx_mcast_flg) {
309-
p_ramrod->common.update_approx_mcast_flg = 1;
310-
for (i = 0; i < ETH_MULTICAST_MAC_BINS_IN_REGS; i++) {
311-
u32 *p_bins = (u32 *)p_params->bins;
312-
__le32 val = cpu_to_le32(p_bins[i]);
308+
if (!p_params->update_approx_mcast_flg)
309+
return;
313310

314-
p_ramrod->approx_mcast.bins[i] = val;
315-
}
311+
p_ramrod->common.update_approx_mcast_flg = 1;
312+
for (i = 0; i < ETH_MULTICAST_MAC_BINS_IN_REGS; i++) {
313+
u32 *p_bins = (u32 *)p_params->bins;
314+
315+
p_ramrod->approx_mcast.bins[i] = cpu_to_le32(p_bins[i]);
316316
}
317317
}
318318

@@ -360,8 +360,8 @@ int qed_sp_vport_update(struct qed_hwfn *p_hwfn,
360360
p_cmn->tx_active_flg = p_params->vport_active_tx_flg;
361361
p_cmn->update_tx_active_flg = p_params->update_vport_active_tx_flg;
362362
p_cmn->accept_any_vlan = p_params->accept_any_vlan;
363-
p_cmn->update_accept_any_vlan_flg =
364-
p_params->update_accept_any_vlan_flg;
363+
val = p_params->update_accept_any_vlan_flg;
364+
p_cmn->update_accept_any_vlan_flg = val;
365365

366366
p_cmn->inner_vlan_removal_en = p_params->inner_vlan_removal_flg;
367367
val = p_params->update_inner_vlan_removal_flg;
@@ -1183,17 +1183,14 @@ qed_sp_eth_filter_mcast(struct qed_hwfn *p_hwfn,
11831183
u8 abs_vport_id = 0;
11841184
int rc, i;
11851185

1186-
if (p_filter_cmd->opcode == QED_FILTER_ADD) {
1186+
if (p_filter_cmd->opcode == QED_FILTER_ADD)
11871187
rc = qed_fw_vport(p_hwfn, p_filter_cmd->vport_to_add_to,
11881188
&abs_vport_id);
1189-
if (rc)
1190-
return rc;
1191-
} else {
1189+
else
11921190
rc = qed_fw_vport(p_hwfn, p_filter_cmd->vport_to_remove_from,
11931191
&abs_vport_id);
1194-
if (rc)
1195-
return rc;
1196-
}
1192+
if (rc)
1193+
return rc;
11971194

11981195
/* Get SPQ entry */
11991196
memset(&init_data, 0, sizeof(init_data));
@@ -1840,8 +1837,8 @@ static int qed_update_vport(struct qed_dev *cdev,
18401837
QED_RSS_IND_TABLE_SIZE * sizeof(u16));
18411838
memcpy(sp_rss_params.rss_key, params->rss_params.rss_key,
18421839
QED_RSS_KEY_SIZE * sizeof(u32));
1840+
sp_params.rss_params = &sp_rss_params;
18431841
}
1844-
sp_params.rss_params = &sp_rss_params;
18451842

18461843
for_each_hwfn(cdev, i) {
18471844
struct qed_hwfn *p_hwfn = &cdev->hwfns[i];

‎drivers/net/ethernet/qlogic/qed/qed_mcp.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
161161

162162
size = MFW_DRV_MSG_MAX_DWORDS(p_info->mfw_mb_length) * sizeof(u32);
163163
p_info->mfw_mb_cur = kzalloc(size, GFP_KERNEL);
164-
p_info->mfw_mb_shadow =
165-
kzalloc(sizeof(u32) * MFW_DRV_MSG_MAX_DWORDS(
166-
p_info->mfw_mb_length), GFP_KERNEL);
164+
p_info->mfw_mb_shadow = kzalloc(size, GFP_KERNEL);
167165
if (!p_info->mfw_mb_shadow || !p_info->mfw_mb_addr)
168166
goto err;
169167

‎drivers/net/ethernet/qlogic/qede/qede_main.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,9 +2704,6 @@ static int qede_alloc_rx_buffer(struct qede_dev *edev,
27042704
struct eth_rx_bd *rx_bd;
27052705
dma_addr_t mapping;
27062706
struct page *data;
2707-
u16 rx_buf_size;
2708-
2709-
rx_buf_size = rxq->rx_buf_size;
27102707

27112708
data = alloc_pages(GFP_ATOMIC, 0);
27122709
if (unlikely(!data)) {

0 commit comments

Comments
 (0)