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
346}346}
347 347
348static inline bool348static inline bool
349ip_set_put_skbinfo(struct sk_buff *skb, struct ip_set_skbinfo *skbinfo)349ip_set_put_skbinfo(struct sk_buff *skb, const struct ip_set_skbinfo *skbinfo)
350{350{
351 /* Send nonzero parameters only */351 /* Send nonzero parameters only */
352 return ((skbinfo->skbmark || skbinfo->skbmarkmask) &&352 return ((skbinfo->skbmark || skbinfo->skbmarkmask) &&
@@ -373,7 +373,7 @@ ip_set_init_skbinfo(struct ip_set_skbinfo *skbinfo, · 20 unmodified lines
373}373}
374 374
375static inline bool375static inline bool
376ip_set_put_counter(struct sk_buff *skb, struct ip_set_counter *counter)376ip_set_put_counter(struct sk_buff *skb, const struct ip_set_counter *counter)
377{377{
378 return nla_put_net64(skb, IPSET_ATTR_BYTES,378 return nla_put_net64(skb, IPSET_ATTR_BYTES,
379 cpu_to_be64(ip_set_get_bytes(counter)),379 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
43 43
44/* Used only when dumping a set, protected by rcu_read_lock_bh() */44/* Used only when dumping a set, protected by rcu_read_lock_bh() */
45static inline int45static inline int
46ip_set_put_comment(struct sk_buff *skb, struct ip_set_comment *comment)46ip_set_put_comment(struct sk_buff *skb, const struct ip_set_comment *comment)
47{47{
48 struct ip_set_comment_rcu *c = rcu_dereference_bh(comment->c);48 struct ip_set_comment_rcu *c = rcu_dereference_bh(comment->c);
49 49
include/linux/netfilter/ipset/ip_set_timeout.h+2−2
@@ -40,7 +40,7 @@ ip_set_timeout_uget(struct nlattr *tb) · 39 unmodified lines
40}40}
41 41
42static inline bool42static inline bool
43ip_set_timeout_expired(unsigned long *t)43ip_set_timeout_expired(const unsigned long *t)
44{44{
45 return *t != IPSET_ELEM_PERMANENT && time_is_before_jiffies(*t);45 return *t != IPSET_ELEM_PERMANENT && time_is_before_jiffies(*t);
46}46}
@@ -63,7 +63,7 @@ ip_set_timeout_set(unsigned long *timeout, u32 value) · 16 unmodified lines
63}63}
64 64
65static inline u3265static inline u32
66ip_set_timeout_get(unsigned long *timeout)66ip_set_timeout_get(const unsigned long *timeout)
67{67{
68 return *timeout == IPSET_ELEM_PERMANENT ? 0 :68 return *timeout == IPSET_ELEM_PERMANENT ? 0 :
69 jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC;69 jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC;