Mark some of the helpers arguments as const. Ported from a patch proposed by Sergey Popovich <popovich_sergei@mail.ua>.
Showing the changes to include/linux/netfilter (3 of 3 files). Show all
Unified · Split
| @@ -346,7 +346,7 @@ ip_set_get_skbinfo(struct ip_set_skbinfo *skbinfo, · 345 unmodified lines | ||
| 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,7 +373,7 @@ ip_set_init_skbinfo(struct ip_set_skbinfo *skbinfo, · 20 unmodified lines | ||
| 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)), |
| @@ -43,7 +43,7 @@ ip_set_init_comment(struct ip_set_comment *comment, · 42 unmodified lines | ||
| 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 | |
| @@ -40,7 +40,7 @@ ip_set_timeout_uget(struct nlattr *tb) · 39 unmodified lines | ||
| 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,7 +63,7 @@ ip_set_timeout_set(unsigned long *timeout, u32 value) · 16 unmodified lines | ||
| 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; |