summaryrefslogtreecommitdiffstats
path: root/net/appletalk
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-06-09 00:17:44 -0700
committerDavid S. Miller <davem@davemloft.net>2009-06-09 00:17:44 -0700
commitc32ba3f9b8aa2441c7cfcd065f79981cf8cfe9f4 (patch)
tree1ceed3e63c6798eb5ae410ae9e6237fb00539c86 /net/appletalk
parenta5bd8a13e9e0322c7f76b34790ba34e2e0ce2ac5 (diff)
downloadop-kernel-dev-c32ba3f9b8aa2441c7cfcd065f79981cf8cfe9f4.zip
op-kernel-dev-c32ba3f9b8aa2441c7cfcd065f79981cf8cfe9f4.tar.gz
appletalk: Use frag list abstraction interfaces.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/appletalk')
-rw-r--r--net/appletalk/ddp.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index d6a9243..b603cba 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -939,6 +939,7 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
int len, unsigned long sum)
{
int start = skb_headlen(skb);
+ struct sk_buff *frag_iter;
int i, copy;
/* checksum stuff in header space */
@@ -977,26 +978,22 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
start = end;
}
- if (skb_shinfo(skb)->frag_list) {
- struct sk_buff *list = skb_shinfo(skb)->frag_list;
-
- for (; list; list = list->next) {
- int end;
+ skb_walk_frags(skb, frag_iter) {
+ int end;
- WARN_ON(start > offset + len);
+ WARN_ON(start > offset + len);
- end = start + list->len;
- if ((copy = end - offset) > 0) {
- if (copy > len)
- copy = len;
- sum = atalk_sum_skb(list, offset - start,
- copy, sum);
- if ((len -= copy) == 0)
- return sum;
- offset += copy;
- }
- start = end;
+ end = start + frag_iter->len;
+ if ((copy = end - offset) > 0) {
+ if (copy > len)
+ copy = len;
+ sum = atalk_sum_skb(frag_iter, offset - start,
+ copy, sum);
+ if ((len -= copy) == 0)
+ return sum;
+ offset += copy;
}
+ start = end;
}
BUG_ON(len > 0);
OpenPOWER on IntegriCloud