]> git.itanic.dy.fi Git - linux-stable/commitdiff
netfilter: nf_tables: de-constify set commit ops function argument
authorFlorian Westphal <fw@strlen.de>
Fri, 13 Oct 2023 12:18:14 +0000 (14:18 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 18 Oct 2023 08:26:43 +0000 (10:26 +0200)
The set backend using this already has to work around this via ugly
cast, don't spread this pattern.

Signed-off-by: Florian Westphal <fw@strlen.de>
include/net/netfilter/nf_tables.h
net/netfilter/nft_set_pipapo.c

index 9fb16485d08fb160abe291e87049c4929e954f5a..8de040d2d2cf855bfd855ab550fa5809a0eadde6 100644 (file)
@@ -462,7 +462,7 @@ struct nft_set_ops {
                                               const struct nft_set *set,
                                               const struct nft_set_elem *elem,
                                               unsigned int flags);
-       void                            (*commit)(const struct nft_set *set);
+       void                            (*commit)(struct nft_set *set);
        void                            (*abort)(const struct nft_set *set);
        u64                             (*privsize)(const struct nlattr * const nla[],
                                                    const struct nft_set_desc *desc);
index c0dcc40de358fb2f364ed15f05a5b166279887aa..75a9dee353e242f1714a8bd831ef546d2ca116ab 100644 (file)
@@ -1549,12 +1549,11 @@ static void nft_pipapo_gc_deactivate(struct net *net, struct nft_set *set,
 
 /**
  * pipapo_gc() - Drop expired entries from set, destroy start and end elements
- * @_set:      nftables API set representation
+ * @set:       nftables API set representation
  * @m:         Matching data
  */
-static void pipapo_gc(const struct nft_set *_set, struct nft_pipapo_match *m)
+static void pipapo_gc(struct nft_set *set, struct nft_pipapo_match *m)
 {
-       struct nft_set *set = (struct nft_set *) _set;
        struct nft_pipapo *priv = nft_set_priv(set);
        struct net *net = read_pnet(&set->net);
        int rules_f0, first_rule = 0;
@@ -1672,7 +1671,7 @@ static void pipapo_reclaim_match(struct rcu_head *rcu)
  * We also need to create a new working copy for subsequent insertions and
  * deletions.
  */
-static void nft_pipapo_commit(const struct nft_set *set)
+static void nft_pipapo_commit(struct nft_set *set)
 {
        struct nft_pipapo *priv = nft_set_priv(set);
        struct nft_pipapo_match *new_clone, *old;