Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eric Dumazet and committed by
David S. Miller
18d07000 e4cbb02a

+12 -8
+12 -8
include/linux/skbuff.h
··· 883 883 */ 884 884 static 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; 887 - if (list == (struct sk_buff *)list_) 888 - list = NULL; 889 - return list; 886 + struct sk_buff *skb = list_->next; 887 + 888 + if (skb == (struct sk_buff *)list_) 889 + skb = NULL; 890 + return skb; 890 891 } 891 892 892 893 /** ··· 903 902 const struct sk_buff_head *list_) 904 903 { 905 904 struct sk_buff *next = skb->next; 905 + 906 906 if (next == (struct sk_buff *)list_) 907 907 next = NULL; 908 908 return next; ··· 924 922 */ 925 923 static inline struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_) 926 924 { 927 - struct sk_buff *list = ((const struct sk_buff *)list_)->prev; 928 - if (list == (struct sk_buff *)list_) 929 - list = NULL; 930 - return list; 925 + struct sk_buff *skb = list_->prev; 926 + 927 + if (skb == (struct sk_buff *)list_) 928 + skb = NULL; 929 + return skb; 930 + 931 931 } 932 932 933 933 /**