qed: Cleanup DCBx unnecessary parameters.
authorsudarsana.kalluru@cavium.com <sudarsana.kalluru@cavium.com>
Fri, 21 Apr 2017 05:31:16 +0000 (22:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Apr 2017 16:19:44 +0000 (12:19 -0400)
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_dcbx.c
drivers/net/ethernet/qlogic/qed/qed_dcbx.h
drivers/net/ethernet/qlogic/qed/qed_dev.c

index e575cfe704546e63db06195940dc3eafdd013e58..3d53d114634393ded1c18ffdba96cd51ecca2b1d 100644 (file)
@@ -271,8 +271,8 @@ qed_dcbx_process_tlv(struct qed_hwfn *p_hwfn,
                     struct dcbx_app_priority_entry *p_tbl,
                     u32 pri_tc_tbl, int count, u8 dcbx_version)
 {
-       u8 tc, priority_map;
        enum dcbx_protocol_type type;
+       u8 tc, priority_map;
        bool enable, ieee;
        u16 protocol_id;
        int priority;
@@ -620,8 +620,7 @@ qed_dcbx_get_common_params(struct qed_hwfn *p_hwfn,
 }
 
 static void
-qed_dcbx_get_local_params(struct qed_hwfn *p_hwfn,
-                         struct qed_ptt *p_ptt, struct qed_dcbx_get *params)
+qed_dcbx_get_local_params(struct qed_hwfn *p_hwfn, struct qed_dcbx_get *params)
 {
        struct dcbx_features *p_feat;
 
@@ -633,8 +632,7 @@ qed_dcbx_get_local_params(struct qed_hwfn *p_hwfn,
 }
 
 static void
-qed_dcbx_get_remote_params(struct qed_hwfn *p_hwfn,
-                          struct qed_ptt *p_ptt, struct qed_dcbx_get *params)
+qed_dcbx_get_remote_params(struct qed_hwfn *p_hwfn, struct qed_dcbx_get *params)
 {
        struct dcbx_features *p_feat;
 
@@ -647,7 +645,6 @@ qed_dcbx_get_remote_params(struct qed_hwfn *p_hwfn,
 
 static void
 qed_dcbx_get_operational_params(struct qed_hwfn *p_hwfn,
-                               struct qed_ptt *p_ptt,
                                struct qed_dcbx_get *params)
 {
        struct qed_dcbx_operational_params *p_operational;
@@ -697,7 +694,6 @@ qed_dcbx_get_operational_params(struct qed_hwfn *p_hwfn,
 
 static void
 qed_dcbx_get_local_lldp_params(struct qed_hwfn *p_hwfn,
-                              struct qed_ptt *p_ptt,
                               struct qed_dcbx_get *params)
 {
        struct lldp_config_params_s *p_local;
@@ -712,7 +708,6 @@ qed_dcbx_get_local_lldp_params(struct qed_hwfn *p_hwfn,
 
 static void
 qed_dcbx_get_remote_lldp_params(struct qed_hwfn *p_hwfn,
-                               struct qed_ptt *p_ptt,
                                struct qed_dcbx_get *params)
 {
        struct lldp_status_params_s *p_remote;
@@ -726,25 +721,24 @@ qed_dcbx_get_remote_lldp_params(struct qed_hwfn *p_hwfn,
 }
 
 static int
-qed_dcbx_get_params(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
-                   struct qed_dcbx_get *p_params,
+qed_dcbx_get_params(struct qed_hwfn *p_hwfn, struct qed_dcbx_get *p_params,
                    enum qed_mib_read_type type)
 {
        switch (type) {
        case QED_DCBX_REMOTE_MIB:
-               qed_dcbx_get_remote_params(p_hwfn, p_ptt, p_params);
+               qed_dcbx_get_remote_params(p_hwfn, p_params);
                break;
        case QED_DCBX_LOCAL_MIB:
-               qed_dcbx_get_local_params(p_hwfn, p_ptt, p_params);
+               qed_dcbx_get_local_params(p_hwfn, p_params);
                break;
        case QED_DCBX_OPERATIONAL_MIB:
-               qed_dcbx_get_operational_params(p_hwfn, p_ptt, p_params);
+               qed_dcbx_get_operational_params(p_hwfn, p_params);
                break;
        case QED_DCBX_REMOTE_LLDP_MIB:
-               qed_dcbx_get_remote_lldp_params(p_hwfn, p_ptt, p_params);
+               qed_dcbx_get_remote_lldp_params(p_hwfn, p_params);
                break;
        case QED_DCBX_LOCAL_LLDP_MIB:
-               qed_dcbx_get_local_lldp_params(p_hwfn, p_ptt, p_params);
+               qed_dcbx_get_local_lldp_params(p_hwfn, p_params);
                break;
        default:
                DP_ERR(p_hwfn, "MIB read err, unknown mib type %d\n", type);
@@ -902,7 +896,8 @@ qed_dcbx_mib_update_event(struct qed_hwfn *p_hwfn,
                        qed_sp_pf_update(p_hwfn);
                }
        }
-       qed_dcbx_get_params(p_hwfn, p_ptt, &p_hwfn->p_dcbx_info->get, type);
+
+       qed_dcbx_get_params(p_hwfn, &p_hwfn->p_dcbx_info->get, type);
        qed_dcbx_aen(p_hwfn, type);
 
        return rc;
@@ -910,17 +905,14 @@ qed_dcbx_mib_update_event(struct qed_hwfn *p_hwfn,
 
 int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn)
 {
-       int rc = 0;
-
        p_hwfn->p_dcbx_info = kzalloc(sizeof(*p_hwfn->p_dcbx_info), GFP_KERNEL);
        if (!p_hwfn->p_dcbx_info)
-               rc = -ENOMEM;
+               return -ENOMEM;
 
-       return rc;
+       return 0;
 }
 
-void qed_dcbx_info_free(struct qed_hwfn *p_hwfn,
-                       struct qed_dcbx_info *p_dcbx_info)
+void qed_dcbx_info_free(struct qed_hwfn *p_hwfn)
 {
        kfree(p_hwfn->p_dcbx_info);
 }
@@ -992,7 +984,7 @@ static int qed_dcbx_query_params(struct qed_hwfn *p_hwfn,
        if (rc)
                goto out;
 
-       rc = qed_dcbx_get_params(p_hwfn, p_ptt, p_get, type);
+       rc = qed_dcbx_get_params(p_hwfn, p_get, type);
 
 out:
        qed_ptt_release(p_hwfn, p_ptt);
index 2eb988fe1298dfd043fbd8c18d49187930a5c970..414e26268f3a7c9ecc4b5954d91ba58c9c9d9470 100644 (file)
@@ -119,7 +119,7 @@ qed_dcbx_mib_update_event(struct qed_hwfn *,
                          struct qed_ptt *, enum qed_mib_read_type);
 
 int qed_dcbx_info_alloc(struct qed_hwfn *p_hwfn);
-void qed_dcbx_info_free(struct qed_hwfn *, struct qed_dcbx_info *);
+void qed_dcbx_info_free(struct qed_hwfn *p_hwfn);
 void qed_dcbx_set_pf_update_params(struct qed_dcbx_results *p_src,
                                   struct pf_update_ramrod_data *p_dest);
 
index fad73195010d01b4d50ad80ff5c7e399787daa94..6d2430896c5a6946a3cdc99ff7a184e34f49fb93 100644 (file)
@@ -183,7 +183,7 @@ void qed_resc_free(struct qed_dev *cdev)
                }
                qed_iov_free(p_hwfn);
                qed_dmae_info_free(p_hwfn);
-               qed_dcbx_info_free(p_hwfn, p_hwfn->p_dcbx_info);
+               qed_dcbx_info_free(p_hwfn);
        }
 }