aboutsummaryrefslogtreecommitdiffstats
path: root/net/appletalk
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2009-11-04 05:26:13 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-08 03:43:19 -0500
commitf7a3a1d8affe563846fc17f0e7c0cc1500190c57 (patch)
tree40ae89d2dc8ba236706ed9d4f73abe78c90ad1a5 /net/appletalk
parentfd5c00276127661f12e0315e3bbec41a1c0be376 (diff)
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')
-rw-r--r--net/appletalk/ddp.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 31fca64d17a2..b631cc734540 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,
922{ 922{
923 /* This ought to be unwrapped neatly. I'll trust gcc for now */ 923 /* This ought to be unwrapped neatly. I'll trust gcc for now */
924 while (len--) { 924 while (len--) {
925 sum += *data; 925 sum += *data++;
926 sum <<= 1; 926 sum = rol16(sum, 1);
927 if (sum & 0x10000) {
928 sum++;
929 sum &= 0xffff;
930 }
931 data++;
932 } 927 }
933 return sum; 928 return sum;
934} 929}