diff options
author | Joe Perches <joe@perches.com> | 2009-11-04 10:26:13 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-08 00:43:19 -0800 |
commit | f7a3a1d8affe563846fc17f0e7c0cc1500190c57 (patch) | |
tree | 40ae89d2dc8ba236706ed9d4f73abe78c90ad1a5 /net/appletalk/ddp.c | |
parent | fd5c00276127661f12e0315e3bbec41a1c0be376 (diff) | |
download | kernel_goldelico_gta04-f7a3a1d8affe563846fc17f0e7c0cc1500190c57.zip kernel_goldelico_gta04-f7a3a1d8affe563846fc17f0e7c0cc1500190c57.tar.gz kernel_goldelico_gta04-f7a3a1d8affe563846fc17f0e7c0cc1500190c57.tar.bz2 |
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>
Diffstat (limited to 'net/appletalk/ddp.c')
-rw-r--r-- | net/appletalk/ddp.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 31fca64..b631cc7 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -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; } |