History

netfilter: ipset: Mark some helper args as const.

Mark some of the helpers arguments as const. Ported from a patch proposed by Sergey Popovich <popovich_sergei@mail.ua>.

Jozsef Kadlecsik committed 10 years ago

Commit da9fbfa1 parent 2da16a63 files · +5 −5Browse files

Showing the changes to include/linux/netfilter (3 of 3 files). Show all

Unified · Split

3 files
  1. include/linux/netfilter/ipset/ip_set.h +2 −2
  2. include/linux/netfilter/ipset/ip_set_comment.h +1 −1
  3. include/linux/netfilter/ipset/ip_set_timeout.h +2 −2
include/linux/netfilter/ipset/ip_set.h+2−2
@@ -346,7 +346,7 @@ ip_set_get_skbinfo(struct ip_set_skbinfo *skbinfo, · 345 unmodified lines
346346 }
347347
348348 static inline bool
349−ip_set_put_skbinfo(struct sk_buff *skb, struct ip_set_skbinfo *skbinfo)
349+ip_set_put_skbinfo(struct sk_buff *skb, const struct ip_set_skbinfo *skbinfo)
350350 {
351351 /* Send nonzero parameters only */
352352 return ((skbinfo->skbmark || skbinfo->skbmarkmask) &&
@@ -373,7 +373,7 @@ ip_set_init_skbinfo(struct ip_set_skbinfo *skbinfo, · 20 unmodified lines
373373 }
374374
375375 static inline bool
376−ip_set_put_counter(struct sk_buff *skb, struct ip_set_counter *counter)
376+ip_set_put_counter(struct sk_buff *skb, const struct ip_set_counter *counter)
377377 {
378378 return nla_put_net64(skb, IPSET_ATTR_BYTES,
379379 cpu_to_be64(ip_set_get_bytes(counter)),
include/linux/netfilter/ipset/ip_set_comment.h+1−1
@@ -43,7 +43,7 @@ ip_set_init_comment(struct ip_set_comment *comment, · 42 unmodified lines
4343
4444 /* Used only when dumping a set, protected by rcu_read_lock_bh() */
4545 static inline int
46−ip_set_put_comment(struct sk_buff *skb, struct ip_set_comment *comment)
46+ip_set_put_comment(struct sk_buff *skb, const struct ip_set_comment *comment)
4747 {
4848 struct ip_set_comment_rcu *c = rcu_dereference_bh(comment->c);
4949
include/linux/netfilter/ipset/ip_set_timeout.h+2−2
@@ -40,7 +40,7 @@ ip_set_timeout_uget(struct nlattr *tb) · 39 unmodified lines
4040 }
4141
4242 static inline bool
43−ip_set_timeout_expired(unsigned long *t)
43+ip_set_timeout_expired(const unsigned long *t)
4444 {
4545 return *t != IPSET_ELEM_PERMANENT && time_is_before_jiffies(*t);
4646 }
@@ -63,7 +63,7 @@ ip_set_timeout_set(unsigned long *timeout, u32 value) · 16 unmodified lines
6363 }
6464
6565 static inline u32
66−ip_set_timeout_get(unsigned long *timeout)
66+ip_set_timeout_get(const unsigned long *timeout)
6767 {
6868 return *timeout == IPSET_ELEM_PERMANENT ? 0 :
6969 jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC;