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>
This commit is contained in:
Jesse Brandeburg 2013-09-28 07:13:49 +00:00 committed by Jeff Kirsher
parent 004173cbbf
commit 0976a01610
1 changed files with 6 additions and 6 deletions

View File

@ -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);