net/ice/base: refactor zeroing bitmap size
authorLeyi Rong <leyi.rong@intel.com>
Wed, 19 Jun 2019 15:18:38 +0000 (23:18 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 28 Jun 2019 18:31:49 +0000 (20:31 +0200)
A couple of places in the code use a 'sizeof(bitmap) * BITS_PER_BYTE'
construction to calculate the size of the bitmap when calling
ice_zero_bitmap. Instead of doing this, just use the same value as in
the ice_declare_bitmap declaration.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/base/ice_sched.c

index 0f41531..2d80af7 100644 (file)
@@ -5259,8 +5259,7 @@ void ice_sched_replay_agg(struct ice_hw *hw)
                                           ICE_MAX_TRAFFIC_CLASS);
                        enum ice_status status;
 
-                       ice_zero_bitmap(replay_bitmap,
-                                       sizeof(replay_bitmap) * BITS_PER_BYTE);
+                       ice_zero_bitmap(replay_bitmap, ICE_MAX_TRAFFIC_CLASS);
                        ice_sched_get_ena_tc_bitmap(pi,
                                                    agg_info->replay_tc_bitmap,
                                                    replay_bitmap);
@@ -5396,7 +5395,7 @@ ice_sched_replay_vsi_agg(struct ice_hw *hw, u16 vsi_handle)
        struct ice_sched_agg_info *agg_info;
        enum ice_status status;
 
-       ice_zero_bitmap(replay_bitmap, sizeof(replay_bitmap) * BITS_PER_BYTE);
+       ice_zero_bitmap(replay_bitmap, ICE_MAX_TRAFFIC_CLASS);
        if (!ice_is_vsi_valid(hw, vsi_handle))
                return ICE_ERR_PARAM;
        agg_info = ice_get_vsi_agg_info(hw, vsi_handle);