Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>.

Suggested-by: Sergey Popovich <popovich_sergei@mail.ua>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>

+5 -5
+2 -2
include/linux/netfilter/ipset/ip_set.h
··· 346 346 } 347 347 348 348 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) 350 350 { 351 351 /* Send nonzero parameters only */ 352 352 return ((skbinfo->skbmark || skbinfo->skbmarkmask) && ··· 373 373 } 374 374 375 375 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) 377 377 { 378 378 return nla_put_net64(skb, IPSET_ATTR_BYTES, 379 379 cpu_to_be64(ip_set_get_bytes(counter)),
+1 -1
include/linux/netfilter/ipset/ip_set_comment.h
··· 43 43 44 44 /* Used only when dumping a set, protected by rcu_read_lock_bh() */ 45 45 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) 47 47 { 48 48 struct ip_set_comment_rcu *c = rcu_dereference_bh(comment->c); 49 49
+2 -2
include/linux/netfilter/ipset/ip_set_timeout.h
··· 40 40 } 41 41 42 42 static inline bool 43 - ip_set_timeout_expired(unsigned long *t) 43 + ip_set_timeout_expired(const unsigned long *t) 44 44 { 45 45 return *t != IPSET_ELEM_PERMANENT && time_is_before_jiffies(*t); 46 46 } ··· 63 63 } 64 64 65 65 static inline u32 66 - ip_set_timeout_get(unsigned long *timeout) 66 + ip_set_timeout_get(const unsigned long *timeout) 67 67 { 68 68 return *timeout == IPSET_ELEM_PERMANENT ? 0 : 69 69 jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC;