drivers/net: avoid some skb->ip_summed initializations
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 2 Sep 2010 20:07:41 +0000 (13:07 -0700)
committerGuo-Fu Tseng <cooldavid@cooldavid.org>
Thu, 30 Sep 2010 07:48:56 +0000 (15:48 +0800)
fresh skbs have ip_summed set to CHECKSUM_NONE (0)

We can avoid setting again skb->ip_summed to CHECKSUM_NONE in drivers.

Introduce skb_checksum_none_assert() helper so that we keep this
assertion documented in driver sources.

Change most occurrences of :

skb->ip_summed = CHECKSUM_NONE;

by :

skb_checksum_none_assert(skb);

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
jme.c

diff --git a/jme.c b/jme.c
index 1fb7277..e8afe85 100644 (file)
--- a/jme.c
+++ b/jme.c
@@ -963,7 +963,11 @@ jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx)
                if (jme_rxsum_ok(jme, le16_to_cpu(rxdesc->descwb.flags)))
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
                else
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,35)
                        skb->ip_summed = CHECKSUM_NONE;
+#else
+                       skb_checksum_none_assert(skb);
+#endif
 
                if (rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_TAGON)) {
                        if (jme->vlgrp) {