Skip to content

Commit

Permalink
net: skbuff: const-ify casts in skb_queue_* functions
Browse files Browse the repository at this point in the history
We should const-ify comparisons on skb_queue_* inline helper
functions as their parameters are const as well, so lets not
drop that.

Suggested-by: Brad Spengler <spender@grsecurity.net>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Jan 7, 2014
1 parent be7928d commit fd44b93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
*/
static inline int skb_queue_empty(const struct sk_buff_head *list)
{
return list->next == (struct sk_buff *)list;
return list->next == (const struct sk_buff *) list;
}

/**
Expand All @@ -840,7 +840,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *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;
return skb->next == (const struct sk_buff *) list;
}

/**
Expand All @@ -853,7 +853,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
static inline bool skb_queue_is_first(const struct sk_buff_head *list,
const struct sk_buff *skb)
{
return skb->prev == (struct sk_buff *)list;
return skb->prev == (const struct sk_buff *) list;
}

/**
Expand Down

0 comments on commit fd44b93

Please sign in to comment.