cxgb4: silence shift wrapping static checker warning
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 9 Jan 2014 05:34:00 +0000 (08:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Jan 2014 19:15:58 +0000 (11:15 -0800)
I don't know how large "tp->vlan_shift" is but static checkers worry
about shift wrapping bugs here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/l2t.c

index cb05be9..81e8402 100644 (file)
@@ -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;