projects
/
platform
/
upstream
/
kernel-adaptation-pc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fd5c002
)
appletalk/ddp.c: Neaten checksum function
author
Joe Perches
<joe@perches.com>
Wed, 4 Nov 2009 10:26:13 +0000
(10:26 +0000)
committer
David S. Miller
<davem@davemloft.net>
Sun, 8 Nov 2009 08:43:19 +0000
(
00:43
-0800)
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>
net/appletalk/ddp.c
patch
|
blob
|
history
diff --git
a/net/appletalk/ddp.c
b/net/appletalk/ddp.c
index
31fca64
..
b631cc7
100644
(file)
--- 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;
}