Commit 83aeb933 authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller

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: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1a635e48
...@@ -540,8 +540,7 @@ int qed_resc_alloc(struct qed_dev *cdev) ...@@ -540,8 +540,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL); cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL);
if (!cdev->reset_stats) { if (!cdev->reset_stats) {
DP_NOTICE(cdev, "Failed to allocate reset statistics\n"); DP_NOTICE(cdev, "Failed to allocate reset statistics\n");
rc = -ENOMEM; goto alloc_no_mem;
goto alloc_err;
} }
return 0; return 0;
...@@ -1463,11 +1462,11 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -1463,11 +1462,11 @@ static int qed_hw_get_nvm_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
link_temp = qed_rd(p_hwfn, p_ptt, link_temp = qed_rd(p_hwfn, p_ptt,
port_cfg_addr + port_cfg_addr +
offsetof(struct nvm_cfg1_port, speed_cap_mask)); offsetof(struct nvm_cfg1_port, speed_cap_mask));
link->speed.advertised_speeds = link_temp &= NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_MASK;
link_temp & NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_MASK; link->speed.advertised_speeds = link_temp;
p_hwfn->mcp_info->link_capabilities.speed_capabilities = link_temp = link->speed.advertised_speeds;
link->speed.advertised_speeds; p_hwfn->mcp_info->link_capabilities.speed_capabilities = link_temp;
link_temp = qed_rd(p_hwfn, p_ptt, link_temp = qed_rd(p_hwfn, p_ptt,
port_cfg_addr + port_cfg_addr +
......
...@@ -295,17 +295,15 @@ static int qed_init_cmd_wr(struct qed_hwfn *p_hwfn, ...@@ -295,17 +295,15 @@ static int qed_init_cmd_wr(struct qed_hwfn *p_hwfn,
switch (GET_FIELD(data, INIT_WRITE_OP_SOURCE)) { switch (GET_FIELD(data, INIT_WRITE_OP_SOURCE)) {
case INIT_SRC_INLINE: case INIT_SRC_INLINE:
qed_wr(p_hwfn, p_ptt, addr, data = le32_to_cpu(p_cmd->args.inline_val);
le32_to_cpu(arg->inline_val)); qed_wr(p_hwfn, p_ptt, addr, data);
break; break;
case INIT_SRC_ZEROS: case INIT_SRC_ZEROS:
if (b_must_dmae || data = le32_to_cpu(p_cmd->args.zeros_count);
(b_can_dmae && (le32_to_cpu(arg->zeros_count) >= 64))) if (b_must_dmae || (b_can_dmae && (data >= 64)))
rc = qed_init_fill_dmae(p_hwfn, p_ptt, addr, 0, rc = qed_init_fill_dmae(p_hwfn, p_ptt, addr, 0, data);
le32_to_cpu(arg->zeros_count));
else else
qed_init_fill(p_hwfn, p_ptt, addr, 0, qed_init_fill(p_hwfn, p_ptt, addr, 0, data);
le32_to_cpu(arg->zeros_count));
break; break;
case INIT_SRC_ARRAY: case INIT_SRC_ARRAY:
rc = qed_init_cmd_array(p_hwfn, p_ptt, p_cmd, rc = qed_init_cmd_array(p_hwfn, p_ptt, p_cmd,
......
...@@ -2413,12 +2413,6 @@ void qed_init_cau_sb_entry(struct qed_hwfn *p_hwfn, ...@@ -2413,12 +2413,6 @@ void qed_init_cau_sb_entry(struct qed_hwfn *p_hwfn,
SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_SB_TIMESET0, 0x7F); SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_SB_TIMESET0, 0x7F);
SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_SB_TIMESET1, 0x7F); SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_SB_TIMESET1, 0x7F);
/* setting the time resultion to a fixed value ( = 1) */
SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_TIMER_RES0,
QED_CAU_DEF_RX_TIMER_RES);
SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_TIMER_RES1,
QED_CAU_DEF_TX_TIMER_RES);
cau_state = CAU_HC_DISABLE_STATE; cau_state = CAU_HC_DISABLE_STATE;
if (cdev->int_coalescing_mode == QED_COAL_MODE_ENABLE) { 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) ...@@ -3133,10 +3127,9 @@ int qed_int_alloc(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
return rc; return rc;
} }
rc = qed_int_sb_attn_alloc(p_hwfn, p_ptt); rc = qed_int_sb_attn_alloc(p_hwfn, p_ptt);
if (rc) { if (rc)
DP_ERR(p_hwfn->cdev, "Failed to allocate sb attn mem\n"); DP_ERR(p_hwfn->cdev, "Failed to allocate sb attn mem\n");
return rc;
}
return rc; return rc;
} }
......
...@@ -305,14 +305,14 @@ qed_sp_update_mcast_bin(struct qed_hwfn *p_hwfn, ...@@ -305,14 +305,14 @@ qed_sp_update_mcast_bin(struct qed_hwfn *p_hwfn,
memset(&p_ramrod->approx_mcast.bins, 0, memset(&p_ramrod->approx_mcast.bins, 0,
sizeof(p_ramrod->approx_mcast.bins)); sizeof(p_ramrod->approx_mcast.bins));
if (p_params->update_approx_mcast_flg) { if (!p_params->update_approx_mcast_flg)
p_ramrod->common.update_approx_mcast_flg = 1; return;
for (i = 0; i < ETH_MULTICAST_MAC_BINS_IN_REGS; i++) {
u32 *p_bins = (u32 *)p_params->bins;
__le32 val = cpu_to_le32(p_bins[i]);
p_ramrod->approx_mcast.bins[i] = val; p_ramrod->common.update_approx_mcast_flg = 1;
} for (i = 0; i < ETH_MULTICAST_MAC_BINS_IN_REGS; i++) {
u32 *p_bins = (u32 *)p_params->bins;
p_ramrod->approx_mcast.bins[i] = cpu_to_le32(p_bins[i]);
} }
} }
...@@ -360,8 +360,8 @@ int qed_sp_vport_update(struct qed_hwfn *p_hwfn, ...@@ -360,8 +360,8 @@ int qed_sp_vport_update(struct qed_hwfn *p_hwfn,
p_cmn->tx_active_flg = p_params->vport_active_tx_flg; p_cmn->tx_active_flg = p_params->vport_active_tx_flg;
p_cmn->update_tx_active_flg = p_params->update_vport_active_tx_flg; p_cmn->update_tx_active_flg = p_params->update_vport_active_tx_flg;
p_cmn->accept_any_vlan = p_params->accept_any_vlan; p_cmn->accept_any_vlan = p_params->accept_any_vlan;
p_cmn->update_accept_any_vlan_flg = val = p_params->update_accept_any_vlan_flg;
p_params->update_accept_any_vlan_flg; p_cmn->update_accept_any_vlan_flg = val;
p_cmn->inner_vlan_removal_en = p_params->inner_vlan_removal_flg; p_cmn->inner_vlan_removal_en = p_params->inner_vlan_removal_flg;
val = p_params->update_inner_vlan_removal_flg; val = p_params->update_inner_vlan_removal_flg;
...@@ -1183,17 +1183,14 @@ qed_sp_eth_filter_mcast(struct qed_hwfn *p_hwfn, ...@@ -1183,17 +1183,14 @@ qed_sp_eth_filter_mcast(struct qed_hwfn *p_hwfn,
u8 abs_vport_id = 0; u8 abs_vport_id = 0;
int rc, i; int rc, i;
if (p_filter_cmd->opcode == QED_FILTER_ADD) { if (p_filter_cmd->opcode == QED_FILTER_ADD)
rc = qed_fw_vport(p_hwfn, p_filter_cmd->vport_to_add_to, rc = qed_fw_vport(p_hwfn, p_filter_cmd->vport_to_add_to,
&abs_vport_id); &abs_vport_id);
if (rc) else
return rc;
} else {
rc = qed_fw_vport(p_hwfn, p_filter_cmd->vport_to_remove_from, rc = qed_fw_vport(p_hwfn, p_filter_cmd->vport_to_remove_from,
&abs_vport_id); &abs_vport_id);
if (rc) if (rc)
return rc; return rc;
}
/* Get SPQ entry */ /* Get SPQ entry */
memset(&init_data, 0, sizeof(init_data)); memset(&init_data, 0, sizeof(init_data));
...@@ -1840,8 +1837,8 @@ static int qed_update_vport(struct qed_dev *cdev, ...@@ -1840,8 +1837,8 @@ static int qed_update_vport(struct qed_dev *cdev,
QED_RSS_IND_TABLE_SIZE * sizeof(u16)); QED_RSS_IND_TABLE_SIZE * sizeof(u16));
memcpy(sp_rss_params.rss_key, params->rss_params.rss_key, memcpy(sp_rss_params.rss_key, params->rss_params.rss_key,
QED_RSS_KEY_SIZE * sizeof(u32)); QED_RSS_KEY_SIZE * sizeof(u32));
sp_params.rss_params = &sp_rss_params;
} }
sp_params.rss_params = &sp_rss_params;
for_each_hwfn(cdev, i) { for_each_hwfn(cdev, i) {
struct qed_hwfn *p_hwfn = &cdev->hwfns[i]; struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
......
...@@ -161,9 +161,7 @@ int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -161,9 +161,7 @@ int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
size = MFW_DRV_MSG_MAX_DWORDS(p_info->mfw_mb_length) * sizeof(u32); size = MFW_DRV_MSG_MAX_DWORDS(p_info->mfw_mb_length) * sizeof(u32);
p_info->mfw_mb_cur = kzalloc(size, GFP_KERNEL); p_info->mfw_mb_cur = kzalloc(size, GFP_KERNEL);
p_info->mfw_mb_shadow = p_info->mfw_mb_shadow = kzalloc(size, GFP_KERNEL);
kzalloc(sizeof(u32) * MFW_DRV_MSG_MAX_DWORDS(
p_info->mfw_mb_length), GFP_KERNEL);
if (!p_info->mfw_mb_shadow || !p_info->mfw_mb_addr) if (!p_info->mfw_mb_shadow || !p_info->mfw_mb_addr)
goto err; goto err;
......
...@@ -2704,9 +2704,6 @@ static int qede_alloc_rx_buffer(struct qede_dev *edev, ...@@ -2704,9 +2704,6 @@ static int qede_alloc_rx_buffer(struct qede_dev *edev,
struct eth_rx_bd *rx_bd; struct eth_rx_bd *rx_bd;
dma_addr_t mapping; dma_addr_t mapping;
struct page *data; struct page *data;
u16 rx_buf_size;
rx_buf_size = rxq->rx_buf_size;
data = alloc_pages(GFP_ATOMIC, 0); data = alloc_pages(GFP_ATOMIC, 0);
if (unlikely(!data)) { if (unlikely(!data)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment