diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2013-09-28 11:13:49 +0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-10-22 17:09:16 +0400 |
commit | 0976a01610e76064bff95704573b3a9c747bca4f (patch) | |
tree | 1f797716b1e1b769b63240e62a5dbf82d7f75ff2 | |
parent | 004173cbbf933b8122aa5bea4211302ca79a0bb0 (diff) | |
download | linux-0976a01610e76064bff95704573b3a9c747bca4f.tar.xz |
i40e: fix sign extension issue
This is a fix for an issue reported by coverity, reported
by Hannes Frederic Sowa.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Hannes Frederic Sowa <hannes@stressinduktion.org>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index fbc40cd29d23..8fc313c2a2e7 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -99,9 +99,9 @@ int i40e_program_fdir_filter(struct i40e_fdir_data *fdir_data, << I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT); else fdir_desc->qindex_flex_ptype_vsi |= - cpu_to_le32((fdir_data->dest_vsi - << I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT) - & I40E_TXD_FLTR_QW0_DEST_VSI_MASK); + cpu_to_le32((((u32)fdir_data->dest_vsi) << + I40E_TXD_FLTR_QW0_DEST_VSI_SHIFT) & + I40E_TXD_FLTR_QW0_DEST_VSI_MASK); fdir_desc->dtype_cmd_cntindex = cpu_to_le32(I40E_TX_DESC_DTYPE_FILTER_PROG); @@ -127,9 +127,9 @@ int i40e_program_fdir_filter(struct i40e_fdir_data *fdir_data, fdir_desc->dtype_cmd_cntindex |= cpu_to_le32(I40E_TXD_FLTR_QW1_CNT_ENA_MASK); fdir_desc->dtype_cmd_cntindex |= - cpu_to_le32((fdir_data->cnt_index - << I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) - & I40E_TXD_FLTR_QW1_CNTINDEX_MASK); + cpu_to_le32((((u32)fdir_data->cnt_index) << + I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) & + I40E_TXD_FLTR_QW1_CNTINDEX_MASK); } fdir_desc->fd_id = cpu_to_le32(fdir_data->fd_id); |