Skip to content

Commit

Permalink
appletalk/ddp.c: Neaten checksum function
Browse files Browse the repository at this point in the history
atalk_sum_partial can now use the rol16 function in bitops.h

Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
JoePerches authored and davem330 committed Nov 8, 2009
1 parent fd5c002 commit f7a3a1d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions net/appletalk/ddp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
while (len--) {
sum += *data;
sum <<= 1;
if (sum & 0x10000) {
sum++;
sum &= 0xffff;
}
data++;
sum += *data++;
sum = rol16(sum, 1);
}
return sum;
}
Expand Down

0 comments on commit f7a3a1d

Please sign in to comment.