net: bcmgenet: simplify circular pointer arithmetic
authorDoug Berger <opendmb@gmail.com>
Tue, 14 Mar 2017 00:41:33 +0000 (17:41 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Mar 2017 04:51:49 +0000 (21:51 -0700)
commitc298ede2fe21e034ab6ba4f15340fadc03ae9663
tree8201f36ecb488e401e01e8a3cdd52f1149aaa891
parent83ee102a6998f808ac4c626e8f72344f0a355527
net: bcmgenet: simplify circular pointer arithmetic

A 2's complement subtraction will always do a borrow, so masking
off the sign bits is the same as conditionally adding (mask+1).

Signed-off-by: Doug Berger <opendmb@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c