qed*: Trivial modifications
authorYuval Mintz <Yuval.Mintz@qlogic.com>
Mon, 15 Aug 2016 07:42:44 +0000 (10:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Aug 2016 20:34:52 +0000 (13:34 -0700)
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>
drivers/net/ethernet/qlogic/qed/qed_dev.c
drivers/net/ethernet/qlogic/qed/qed_init_ops.c
drivers/net/ethernet/qlogic/qed/qed_int.c
drivers/net/ethernet/qlogic/qed/qed_l2.c
drivers/net/ethernet/qlogic/qed/qed_mcp.c
drivers/net/ethernet/qlogic/qede/qede_main.c

index 6d105c8d3bbdc3affae2d3d45e39dcdb092daadb..1371ea07f8765387503404dadb3cb8372cd91a8d 100644 (file)
@@ -540,8 +540,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
        cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL);
        if (!cdev->reset_stats) {
                DP_NOTICE(cdev, "Failed to allocate reset statistics\n");
-               rc = -ENOMEM;
-               goto alloc_err;
+               goto alloc_no_mem;
        }
 
        return 0;
@@ -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,
                           port_cfg_addr +
                           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->speed.advertised_speeds;
+       link_temp = link->speed.advertised_speeds;
+       p_hwfn->mcp_info->link_capabilities.speed_capabilities = link_temp;
 
        link_temp = qed_rd(p_hwfn, p_ptt,
                           port_cfg_addr +
index 57044eeeef24182545a78888d224e45ddb6f02c6..b7a4b27ebdbdea0921d57b6849a29c9b1b43a5c4 100644 (file)
@@ -295,17 +295,15 @@ static int qed_init_cmd_wr(struct qed_hwfn *p_hwfn,
 
        switch (GET_FIELD(data, INIT_WRITE_OP_SOURCE)) {
        case INIT_SRC_INLINE:
-               qed_wr(p_hwfn, p_ptt, addr,
-                      le32_to_cpu(arg->inline_val));
+               data = le32_to_cpu(p_cmd->args.inline_val);
+               qed_wr(p_hwfn, p_ptt, addr, data);
                break;
        case INIT_SRC_ZEROS:
-               if (b_must_dmae ||
-                   (b_can_dmae && (le32_to_cpu(arg->zeros_count) >= 64)))
-                       rc = qed_init_fill_dmae(p_hwfn, p_ptt, addr, 0,
-                                               le32_to_cpu(arg->zeros_count));
+               data = le32_to_cpu(p_cmd->args.zeros_count);
+               if (b_must_dmae || (b_can_dmae && (data >= 64)))
+                       rc = qed_init_fill_dmae(p_hwfn, p_ptt, addr, 0, data);
                else
-                       qed_init_fill(p_hwfn, p_ptt, addr, 0,
-                                     le32_to_cpu(arg->zeros_count));
+                       qed_init_fill(p_hwfn, p_ptt, addr, 0, data);
                break;
        case INIT_SRC_ARRAY:
                rc = qed_init_cmd_array(p_hwfn, p_ptt, p_cmd,
index 2afa7a09e1a3e38521768f1993a64120e153cdd8..a701b7640e7cd767d0ac08b843285867b9839a6c 100644 (file)
@@ -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_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;
 
        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)
                return rc;
        }
        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");
-               return rc;
-       }
+
        return rc;
 }
 
index b5d844568107ae50029c348b2df1be3fd36a97f7..c823c46fd9797c554dda9ffc2e053abbf10ada3e 100644 (file)
@@ -305,14 +305,14 @@ qed_sp_update_mcast_bin(struct qed_hwfn *p_hwfn,
        memset(&p_ramrod->approx_mcast.bins, 0,
               sizeof(p_ramrod->approx_mcast.bins));
 
-       if (p_params->update_approx_mcast_flg) {
-               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;
-                       __le32 val = cpu_to_le32(p_bins[i]);
+       if (!p_params->update_approx_mcast_flg)
+               return;
 
-                       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,
        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->accept_any_vlan = p_params->accept_any_vlan;
-       p_cmn->update_accept_any_vlan_flg =
-                       p_params->update_accept_any_vlan_flg;
+       val = 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;
        val = p_params->update_inner_vlan_removal_flg;
@@ -1183,17 +1183,14 @@ qed_sp_eth_filter_mcast(struct qed_hwfn *p_hwfn,
        u8 abs_vport_id = 0;
        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,
                                  &abs_vport_id);
-               if (rc)
-                       return rc;
-       } else {
+       else
                rc = qed_fw_vport(p_hwfn, p_filter_cmd->vport_to_remove_from,
                                  &abs_vport_id);
-               if (rc)
-                       return rc;
-       }
+       if (rc)
+               return rc;
 
        /* Get SPQ entry */
        memset(&init_data, 0, sizeof(init_data));
@@ -1840,8 +1837,8 @@ static int qed_update_vport(struct qed_dev *cdev,
                       QED_RSS_IND_TABLE_SIZE * sizeof(u16));
                memcpy(sp_rss_params.rss_key, params->rss_params.rss_key,
                       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) {
                struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
index 4a82b99c5a45b88995604f9238ddabc255107588..0a676db02c8a52c8ea7c6ac65ce4fb30a32bfd64 100644 (file)
@@ -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);
        p_info->mfw_mb_cur = kzalloc(size, GFP_KERNEL);
-       p_info->mfw_mb_shadow =
-               kzalloc(sizeof(u32) * MFW_DRV_MSG_MAX_DWORDS(
-                               p_info->mfw_mb_length), GFP_KERNEL);
+       p_info->mfw_mb_shadow = kzalloc(size, GFP_KERNEL);
        if (!p_info->mfw_mb_shadow || !p_info->mfw_mb_addr)
                goto err;
 
index f4230d4a4fbd43ab80f0004f9af94fd17a472ee2..3a99eaa9aa8454c050b8b77917fd3d65d8c8da8a 100644 (file)
@@ -2704,9 +2704,6 @@ static int qede_alloc_rx_buffer(struct qede_dev *edev,
        struct eth_rx_bd *rx_bd;
        dma_addr_t mapping;
        struct page *data;
-       u16 rx_buf_size;
-
-       rx_buf_size = rxq->rx_buf_size;
 
        data = alloc_pages(GFP_ATOMIC, 0);
        if (unlikely(!data)) {