cxgb4: silence shift wrapping static checker warning
PATCH 1/1 cxgb4: silence shift wrapping static checker warning
I don't know how large "tp->vlan_shift" is but static checkers worry about shift wrapping bugs here.
Signed-off-by Dan Carpenter <[email protected]>
drivers/net/ethernet/chelsio/cxgb4/l2t.c +1 -1
@@ -423,7 +423,7 @@ u64 cxgb4_select_ntuple(struct net_device *dev,* in the Compressed Filter Tuple. */ if (tp->vlan_shift >=0 && l2t->vlan !=VLAN_NONE ) - ntuple |= (F_FT_VLAN_VLD | l2t->vlan) << tp->vlan_shift; + ntuple |= (u64)(F_FT_VLAN_VLD | l2t->vlan) << tp->vlan_shift;if (tp->port_shift >=0 ) ntuple |= (u64 )l2t->lport << tp->port_shift;
Quoted 2 lines
I don't know how large "
tp->vlan_shift" is but static checkers worry about shift wrapping bugs here.
Indeed.
Quoted 1 line
Signed-off-by Dan Carpenter <[email protected]>
Quoted 14 lines
drivers/net/ethernet/chelsio/cxgb4/l2t.c +1
-1@@ -423,7 +423,7 @@ u64 cxgb4_select_ntuple(struct net_device *dev,* in the Compressed Filter Tuple. */ if (tp->vlan_shift >=0 && l2t->vlan !=VLAN_NONE ) - ntuple |= (F_FT_VLAN_VLD | l2t->vlan) << tp->vlan_shift; + ntuple |= (u64)(F_FT_VLAN_VLD | l2t->vlan) << tp->vlan_shift;if (tp->port_shift >=0 ) ntuple |= (u64 )l2t->lport << tp->port_shift;
From: Dan Carpenter <[email protected]>
Date: Thu, 9 Jan 2014 08:34:00 +0300
Quoted 4 lines
I don't know how large "
tp->vlan_shift" is but static checkers worry about shift wrapping bugs here.Signed-off-by Dan Carpenter <[email protected]>
Applied to 'net'.
I don't think I'll be able to get this into 3.13, but on the off chance Linus has to do another -rc I'll try to send it to him.