aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40e/i40e_common.c
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@intel.com>2015-02-27 09:18:30 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-03-09 05:20:45 -0700
commit1efc80eeee8c89188e78545c87a613e480aefd96 (patch)
tree6976f204811ef4c97368fed22a339674db1fd6bb /drivers/net/ethernet/intel/i40e/i40e_common.c
parenti40e: Remove "hello world" strings from i40e driver (diff)
downloadlinux-dev-1efc80eeee8c89188e78545c87a613e480aefd96.tar.xz
linux-dev-1efc80eeee8c89188e78545c87a613e480aefd96.zip
i40e: future proof some sizeof calls
Make sure the sizeof() calls are taking the size of the actual struct that we care about. By using the pointer variable, we'll always get the right struct size, even if the variable type changes sometime in the future. Change-ID: Id5858f883cf42447365ea3733080d7714f975bce Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index fb78bdd2eb95..2ca3d0959a3c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -2017,7 +2017,7 @@ i40e_status i40e_aq_add_macvlan(struct i40e_hw *hw, u16 seid,
if (count == 0 || !mv_list || !hw)
return I40E_ERR_PARAM;
- buf_size = count * sizeof(struct i40e_aqc_add_macvlan_element_data);
+ buf_size = count * sizeof(*mv_list);
/* prep the rest of the request */
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_add_macvlan);
@@ -2059,7 +2059,7 @@ i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid,
if (count == 0 || !mv_list || !hw)
return I40E_ERR_PARAM;
- buf_size = count * sizeof(struct i40e_aqc_remove_macvlan_element_data);
+ buf_size = count * sizeof(*mv_list);
/* prep the rest of the request */
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_remove_macvlan);