From: Luis R. Rodriguez Date: Wed, 8 Jul 2009 22:43:58 +0000 (-0700) Subject: Fix compilation on 2.6.28 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=21210cae157ae5275f935996328df2d67e549265;p=openwrt%2Fstaging%2Fblogic.git Fix compilation on 2.6.28 Reported-by: Sticky__ via IRC #linux-wireless Signed-off-by: Luis R. Rodriguez --- diff --git a/compat/compat-2.6.28.h b/compat/compat-2.6.28.h index 5d84168a9d63..cb956b74157e 100644 --- a/compat/compat-2.6.28.h +++ b/compat/compat-2.6.28.h @@ -30,6 +30,36 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); +/** + * skb_queue_is_last - check if skb is the last entry in the queue + * @list: queue head + * @skb: buffer + * + * Returns true if @skb is the last buffer on the list. + */ +static inline bool skb_queue_is_last(const struct sk_buff_head *list, + const struct sk_buff *skb) +{ + return (skb->next == (struct sk_buff *) list); +} + +/** + * skb_queue_next - return the next packet in the queue + * @list: queue head + * @skb: current buffer + * + * Return the next packet in @list after @skb. It is only valid to + * call this if skb_queue_is_last() evaluates to false. + */ +static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list, + const struct sk_buff *skb) +{ + /* This BUG_ON may seem severe, but if we just return then we + * are going to dereference garbage. + */ + BUG_ON(skb_queue_is_last(list, skb)); + return skb->next; +} /** * __skb_queue_head_init - initialize non-spinlock portions of sk_buff_head diff --git a/compat/compat-2.6.29.h b/compat/compat-2.6.29.h index 6fa4654d5c29..f4086e92e6a9 100644 --- a/compat/compat-2.6.29.h +++ b/compat/compat-2.6.29.h @@ -40,37 +40,6 @@ static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list, return skb->prev; } -/** - * skb_queue_is_last - check if skb is the last entry in the queue - * @list: queue head - * @skb: buffer - * - * Returns true if @skb is the last buffer on the list. - */ -static inline bool skb_queue_is_last(const struct sk_buff_head *list, - const struct sk_buff *skb) -{ - return (skb->next == (struct sk_buff *) list); -} - -/** - * skb_queue_next - return the next packet in the queue - * @list: queue head - * @skb: current buffer - * - * Return the next packet in @list after @skb. It is only valid to - * call this if skb_queue_is_last() evaluates to false. - */ -static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list, - const struct sk_buff *skb) -{ - /* This BUG_ON may seem severe, but if we just return then we - * are going to dereference garbage. - */ - BUG_ON(skb_queue_is_last(list, skb)); - return skb->next; -} - #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */ #endif /* LINUX_26_29_COMPAT_H */