aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet2012-04-30 11:31:46 -0500
committerDavid S. Miller2012-05-01 08:39:48 -0500
commit18d0700024d68a075c507b845d85eda2abb5aee7 (patch)
treebc733355c1aa30aa3e24cadf26747413ca74a207
parente4cbb02a1070ebf0185f67a8887cc05f8a183d71 (diff)
downloadkernel-omap-18d0700024d68a075c507b845d85eda2abb5aee7.tar.gz
kernel-omap-18d0700024d68a075c507b845d85eda2abb5aee7.tar.xz
kernel-omap-18d0700024d68a075c507b845d85eda2abb5aee7.zip
net: skb_peek()/skb_peek_tail() cleanups
remove useless casts and rename variables for less confusion. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/skbuff.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2c75e98953b2..988fc49667b1 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -883,10 +883,11 @@ static inline struct sk_buff *skb_unshare(struct sk_buff *skb,
883 */ 883 */
884static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_) 884static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_)
885{ 885{
886 struct sk_buff *list = ((const struct sk_buff *)list_)->next; 886 struct sk_buff *skb = list_->next;
887 if (list == (struct sk_buff *)list_) 887
888 list = NULL; 888 if (skb == (struct sk_buff *)list_)
889 return list; 889 skb = NULL;
890 return skb;
890} 891}
891 892
892/** 893/**
@@ -902,6 +903,7 @@ static inline struct sk_buff *skb_peek_next(struct sk_buff *skb,
902 const struct sk_buff_head *list_) 903 const struct sk_buff_head *list_)
903{ 904{
904 struct sk_buff *next = skb->next; 905 struct sk_buff *next = skb->next;
906
905 if (next == (struct sk_buff *)list_) 907 if (next == (struct sk_buff *)list_)
906 next = NULL; 908 next = NULL;
907 return next; 909 return next;
@@ -922,10 +924,12 @@ static inline struct sk_buff *skb_peek_next(struct sk_buff *skb,
922 */ 924 */
923static inline struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_) 925static inline struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_)
924{ 926{
925 struct sk_buff *list = ((const struct sk_buff *)list_)->prev; 927 struct sk_buff *skb = list_->prev;
926 if (list == (struct sk_buff *)list_) 928
927 list = NULL; 929 if (skb == (struct sk_buff *)list_)
928 return list; 930 skb = NULL;
931 return skb;
932
929} 933}
930 934
931/** 935/**