netdev
[Top] [All Lists]

[PATCH] more const in skbuff

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: [PATCH] more const in skbuff
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Thu, 18 Sep 2003 10:27:09 -0700
Cc: netdev@xxxxxxxxxxx
Organization: Open Source Development Lab
Sender: netdev-bounce@xxxxxxxxxxx
More test inline functions should take const args.

diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h
--- a/include/linux/skbuff.h    Thu Sep 18 10:24:35 2003
+++ b/include/linux/skbuff.h    Thu Sep 18 10:24:35 2003
@@ -306,7 +306,7 @@
  *
  *     Returns true if the queue is empty, false otherwise.
  */
-static inline int skb_queue_empty(struct sk_buff_head *list)
+static inline int skb_queue_empty(const struct sk_buff_head *list)
 {
        return list->next == (struct sk_buff *)list;
 }
@@ -357,7 +357,7 @@
  *     one of multiple shared copies of the buffer. Cloned buffers are
  *     shared data so must not be written to under normal circumstances.
  */
-static inline int skb_cloned(struct sk_buff *skb)
+static inline int skb_cloned(const struct sk_buff *skb)
 {
        return skb->cloned && atomic_read(&skb_shinfo(skb)->dataref) != 1;
 }
@@ -369,7 +369,7 @@
  *     Returns true if more than one person has a reference to this
  *     buffer.
  */
-static inline int skb_shared(struct sk_buff *skb)
+static inline int skb_shared(const struct sk_buff *skb)
 {
        return atomic_read(&skb->users) != 1;
 }
@@ -477,7 +477,7 @@
  *
  *     Return the length of an &sk_buff queue.
  */
-static inline __u32 skb_queue_len(struct sk_buff_head *list_)
+static inline __u32 skb_queue_len(const struct sk_buff_head *list_)
 {
        return list_->qlen;
 }

<Prev in Thread] Current Thread [Next in Thread>