]> err.no Git - linux-2.6/commitdiff
ieee1394: eth1394: clean up fragment_overlap
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Mon, 2 Apr 2007 00:21:46 +0000 (02:21 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Sun, 29 Apr 2007 22:00:31 +0000 (00:00 +0200)
offset > fi->offset + fi->len - 1  ==  !(offset < fi->offset + fi->len)
offset + len - 1 < fi->offset      ==  !(offset + len > fi->offset)
!(A || B)  ==  (!A && !B)

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/ieee1394/eth1394.c

index 0047343dbc22b384cc3fac610c6294e7d0e67004..08f63c8d9b25172a68496667d3059e7699532ef1 100644 (file)
@@ -867,12 +867,12 @@ static u16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev,
 static int fragment_overlap(struct list_head *frag_list, int offset, int len)
 {
        struct fragment_info *fi;
+       int end = offset + len;
 
-       list_for_each_entry(fi, frag_list, list) {
-               if ( ! ((offset > (fi->offset + fi->len - 1)) ||
-                      ((offset + len - 1) < fi->offset)))
+       list_for_each_entry(fi, frag_list, list)
+               if (offset < fi->offset + fi->len && end > fi->offset)
                        return 1;
-       }
+
        return 0;
 }