mirror of
https://github.com/torvalds/linux.git
synced 2024-10-24 14:10:59 +00:00
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>
This commit is contained in:
parent
fd5c002761
commit
f7a3a1d8af
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user