fm10k/base: remove useless else
[dpdk.git] / drivers / net / fm10k / base / fm10k_pf.c
index 6e6d71e..3ee88b6 100644 (file)
@@ -379,8 +379,8 @@ STATIC s32 fm10k_update_xc_addr_pf(struct fm10k_hw *hw, u16 glort,
                                                 ((u32)mac[3] << 16) |
                                                 ((u32)mac[4] << 8) |
                                                 ((u32)mac[5]));
-       mac_update.mac_upper = FM10K_CPU_TO_LE16(((u32)mac[0] << 8) |
-                                                ((u32)mac[1]));
+       mac_update.mac_upper = FM10K_CPU_TO_LE16(((u16)mac[0] << 8) |
+                                          ((u16)mac[1]));
        mac_update.vlan = FM10K_CPU_TO_LE16(vid);
        mac_update.glort = FM10K_CPU_TO_LE16(glort);
        mac_update.action = add ? 0 : 1;
@@ -958,7 +958,8 @@ STATIC s32 fm10k_iov_assign_default_mac_vlan_pf(struct fm10k_hw *hw,
        FM10K_WRITE_REG(hw, FM10K_TDBAH(vf_q_idx), tdbah);
 
        /* Provide the VF the ITR scale, using software-defined fields in TDLEN
-        * to pass the information during VF initialization
+        * to pass the information during VF initialization. See definition of
+        * FM10K_TDLEN_ITR_SCALE_SHIFT for more details.
         */
        FM10K_WRITE_REG(hw, FM10K_TDLEN(vf_q_idx), hw->mac.itr_scale <<
                                                   FM10K_TDLEN_ITR_SCALE_SHIFT);
@@ -1095,6 +1096,9 @@ STATIC s32 fm10k_iov_reset_resources_pf(struct fm10k_hw *hw,
        for (i = queues_per_pool; i--;) {
                FM10K_WRITE_REG(hw, FM10K_TDBAL(vf_q_idx + i), tdbal);
                FM10K_WRITE_REG(hw, FM10K_TDBAH(vf_q_idx + i), tdbah);
+               /* See definition of FM10K_TDLEN_ITR_SCALE_SHIFT for an
+                * explanation of how TDLEN is used.
+                */
                FM10K_WRITE_REG(hw, FM10K_TDLEN(vf_q_idx + i),
                                hw->mac.itr_scale <<
                                FM10K_TDLEN_ITR_SCALE_SHIFT);
@@ -1274,8 +1278,8 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results,
                err = fm10k_iov_select_vid(vf_info, (u16)vid);
                if (err < 0)
                        return err;
-               else
-                       vid = err;
+
+               vid = err;
 
                /* update VSI info for VF in regards to VLAN table */
                err = hw->mac.ops.update_vlan(hw, vid, vf_info->vsi, set);
@@ -1300,8 +1304,8 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results,
                err = fm10k_iov_select_vid(vf_info, vlan);
                if (err < 0)
                        return err;
-               else
-                       vlan = (u16)err;
+
+               vlan = (u16)err;
 
                /* notify switch of request for new unicast address */
                err = hw->mac.ops.update_uc_addr(hw, vf_info->glort,
@@ -1326,8 +1330,8 @@ s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results,
                err = fm10k_iov_select_vid(vf_info, vlan);
                if (err < 0)
                        return err;
-               else
-                       vlan = (u16)err;
+
+               vlan = (u16)err;
 
                /* notify switch of request for new multicast address */
                err = hw->mac.ops.update_mc_addr(hw, vf_info->glort,
@@ -1457,6 +1461,7 @@ s32 fm10k_iov_msg_lport_state_pf(struct fm10k_hw *hw, u32 **results,
        return err;
 }
 
+#ifndef NO_DEFAULT_SRIOV_MSG_HANDLERS
 const struct fm10k_msg_data fm10k_iov_msg_data_pf[] = {
        FM10K_TLV_MSG_TEST_HANDLER(fm10k_tlv_msg_test),
        FM10K_VF_MSG_MSIX_HANDLER(fm10k_iov_msg_msix_pf),
@@ -1465,6 +1470,7 @@ const struct fm10k_msg_data fm10k_iov_msg_data_pf[] = {
        FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error),
 };
 
+#endif
 /**
  *  fm10k_update_stats_hw_pf - Updates hardware related statistics of PF
  *  @hw: pointer to hardware structure
@@ -1494,9 +1500,10 @@ STATIC void fm10k_update_hw_stats_pf(struct fm10k_hw *hw,
                xec = fm10k_read_hw_stats_32b(hw, FM10K_STATS_XEC, &stats->xec);
                vlan_drop = fm10k_read_hw_stats_32b(hw, FM10K_STATS_VLAN_DROP,
                                                    &stats->vlan_drop);
-               loopback_drop = fm10k_read_hw_stats_32b(hw,
-                                                       FM10K_STATS_LOOPBACK_DROP,
-                                                       &stats->loopback_drop);
+               loopback_drop =
+                       fm10k_read_hw_stats_32b(hw,
+                                               FM10K_STATS_LOOPBACK_DROP,
+                                               &stats->loopback_drop);
                nodesc_drop = fm10k_read_hw_stats_32b(hw,
                                                      FM10K_STATS_NODESC_DROP,
                                                      &stats->nodesc_drop);
@@ -1754,8 +1761,8 @@ const struct fm10k_tlv_attr fm10k_update_pvid_msg_attr[] = {
  *
  *  This handler configures the default VLAN for the PF
  **/
-s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *hw, u32 **results,
-                            struct fm10k_mbx_info *mbx)
+static s32 fm10k_msg_update_pvid_pf(struct fm10k_hw *hw, u32 **results,
+                                   struct fm10k_mbx_info *mbx)
 {
        u16 glort, pvid;
        u32 pvid_update;