Commit f7a3a1d8 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

appletalk/ddp.c: Neaten checksum function

atalk_sum_partial can now use the rol16 function in bitops.h
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fd5c0027
...@@ -922,13 +922,8 @@ static unsigned long atalk_sum_partial(const unsigned char *data, ...@@ -922,13 +922,8 @@ static unsigned long atalk_sum_partial(const unsigned char *data,
{ {
/* This ought to be unwrapped neatly. I'll trust gcc for now */ /* This ought to be unwrapped neatly. I'll trust gcc for now */
while (len--) { while (len--) {
sum += *data; sum += *data++;
sum <<= 1; sum = rol16(sum, 1);
if (sum & 0x10000) {
sum++;
sum &= 0xffff;
}
data++;
} }
return sum; return sum;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment