]> git.baikalelectronics.ru Git - kernel.git/commit
ipg: fix an unsigned widening cast of '~' truncation issue
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 14 May 2013 21:20:02 +0000 (21:20 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 May 2013 21:42:14 +0000 (14:42 -0700)
commitf099469cbbed8f16e3a31d95bc25880f1cda6cfa
treeee22ad6ce525fcdf66fd9ac3bf73e7591b2f718b
parent5adb245db147cb5f546e602485c5a3b764d2a699
ipg: fix an unsigned widening cast of '~' truncation issue

The bug here is this code from ipg_nic_hard_start_xmit():

txfd->tfc &= cpu_to_le64(~IPG_TFC_TFDDONE);

IPG_TFC_TFDDONE is 0x0000000080000000 so it's an unsigned int.  The
negated value is 0x7fffffff but 0xffffffff7fffffff was intended.

The other values in this file don't need to be changed but I did it for
consistency.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/icplus/ipg.h