[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230105040531.353563-9-kuba@kernel.org>
Date: Wed, 4 Jan 2023 20:05:24 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
jacob.e.keller@...el.com, jiri@...nulli.us,
Jakub Kicinski <kuba@...nel.org>, Jiri Pirko <jiri@...dia.com>
Subject: [PATCH net-next v2 08/15] devlink: drop the filter argument from devlinks_xa_find_get
Looks like devlinks_xa_find_get() was intended to get the mark
from the @filter argument. It doesn't actually use @filter, passing
DEVLINK_REGISTERED to xa_find_fn() directly. Walking marks other
than registered is unlikely so drop @filter argument completely.
Reviewed-by: Jiri Pirko <jiri@...dia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Signed-off-by: Jakub Kicinski <kuba@...nel.org>
---
net/devlink/core.c | 12 +++++-------
net/devlink/devl_internal.h | 15 +++++----------
2 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/net/devlink/core.c b/net/devlink/core.c
index c084eafa17fb..3a99bf84632e 100644
--- a/net/devlink/core.c
+++ b/net/devlink/core.c
@@ -92,7 +92,7 @@ void devlink_put(struct devlink *devlink)
}
static struct devlink *
-devlinks_xa_find_get(struct net *net, unsigned long *indexp, xa_mark_t filter,
+devlinks_xa_find_get(struct net *net, unsigned long *indexp,
void * (*xa_find_fn)(struct xarray *, unsigned long *,
unsigned long, xa_mark_t))
{
@@ -125,17 +125,15 @@ devlinks_xa_find_get(struct net *net, unsigned long *indexp, xa_mark_t filter,
}
struct devlink *
-devlinks_xa_find_get_first(struct net *net, unsigned long *indexp,
- xa_mark_t filter)
+devlinks_xa_find_get_first(struct net *net, unsigned long *indexp)
{
- return devlinks_xa_find_get(net, indexp, filter, xa_find);
+ return devlinks_xa_find_get(net, indexp, xa_find);
}
struct devlink *
-devlinks_xa_find_get_next(struct net *net, unsigned long *indexp,
- xa_mark_t filter)
+devlinks_xa_find_get_next(struct net *net, unsigned long *indexp)
{
- return devlinks_xa_find_get(net, indexp, filter, xa_find_after);
+ return devlinks_xa_find_get(net, indexp, xa_find_after);
}
/**
diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h
index e8cd0e4b6227..d680783e13be 100644
--- a/net/devlink/devl_internal.h
+++ b/net/devlink/devl_internal.h
@@ -81,20 +81,15 @@ extern struct genl_family devlink_nl_family;
* devlink_put() needs to be called for each iterated devlink pointer
* in loop body in order to release the reference.
*/
-#define devlinks_xa_for_each_get(net, index, devlink, filter) \
- for (index = 0, \
- devlink = devlinks_xa_find_get_first(net, &index, filter); \
- devlink; devlink = devlinks_xa_find_get_next(net, &index, filter))
-
#define devlinks_xa_for_each_registered_get(net, index, devlink) \
- devlinks_xa_for_each_get(net, index, devlink, DEVLINK_REGISTERED)
+ for (index = 0, \
+ devlink = devlinks_xa_find_get_first(net, &index); \
+ devlink; devlink = devlinks_xa_find_get_next(net, &index))
struct devlink *
-devlinks_xa_find_get_first(struct net *net, unsigned long *indexp,
- xa_mark_t filter);
+devlinks_xa_find_get_first(struct net *net, unsigned long *indexp);
struct devlink *
-devlinks_xa_find_get_next(struct net *net, unsigned long *indexp,
- xa_mark_t filter);
+devlinks_xa_find_get_next(struct net *net, unsigned long *indexp);
/* Netlink */
#define DEVLINK_NL_FLAG_NEED_PORT BIT(0)
--
2.38.1
Powered by blists - more mailing lists