Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

appletalk/ddp.c: Neaten checksum function

atalk_sum_partial can now use the rol16 function in bitops.h

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Joe Perches and committed by
David S. Miller
f7a3a1d8 fd5c0027

+2 -7
+2 -7
net/appletalk/ddp.c
··· 922 922 { 923 923 /* This ought to be unwrapped neatly. I'll trust gcc for now */ 924 924 while (len--) { 925 - sum += *data; 926 - sum <<= 1; 927 - if (sum & 0x10000) { 928 - sum++; 929 - sum &= 0xffff; 930 - } 931 - data++; 925 + sum += *data++; 926 + sum = rol16(sum, 1); 932 927 } 933 928 return sum; 934 929 }