aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-09-02 16:07:41 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-02 22:06:22 -0400
commitbc8acf2c8c3e43fcc192762a9f964b3e9a17748b (patch)
treee3a91392771a22390e59c24fcb7bad3045ce17d1 /include/linux/skbuff.h
parent7162f6691e9d39d8d866574687cddb3f1ec65d72 (diff)
drivers/net: avoid some skb->ip_summed initializations
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>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f900ffcd847e..9e8085a89589 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2206,6 +2206,21 @@ static inline void skb_forward_csum(struct sk_buff *skb)
2206 skb->ip_summed = CHECKSUM_NONE; 2206 skb->ip_summed = CHECKSUM_NONE;
2207} 2207}
2208 2208
2209/**
2210 * skb_checksum_none_assert - make sure skb ip_summed is CHECKSUM_NONE
2211 * @skb: skb to check
2212 *
2213 * fresh skbs have their ip_summed set to CHECKSUM_NONE.
2214 * Instead of forcing ip_summed to CHECKSUM_NONE, we can
2215 * use this helper, to document places where we make this assertion.
2216 */
2217static inline void skb_checksum_none_assert(struct sk_buff *skb)
2218{
2219#ifdef DEBUG
2220 BUG_ON(skb->ip_summed != CHECKSUM_NONE);
2221#endif
2222}
2223
2209bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2224bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2210#endif /* __KERNEL__ */ 2225#endif /* __KERNEL__ */
2211#endif /* _LINUX_SKBUFF_H */ 2226#endif /* _LINUX_SKBUFF_H */