Re: [PATCH v6 net-next 03/15] net-shapers: implement NL get operation

From
Jakub Kicinski <kuba@kernel.org>
Date
2024-09-05 01:11:30
Also in
intel-wired-lan
Reply to
Paolo Abeni, 2024-09-04
On Wed,  4 Sep 2024 15:53:35 +0200 Paolo Abeni wrote:
quoted hunk ↗ jump to hunk
+static int net_shaper_ctx_setup(const struct genl_info *info, int type,
+				struct net_shaper_nl_ctx *ctx)
+{
+	struct net *ns = genl_info_net(info);
+	struct net_device *dev;
+	int ifindex;
+
+	memset(ctx, 0, sizeof(*ctx));
Don't think you need to memset() this?
Patch 1 touches the relevant memset()s in the core.
quoted hunk ↗ jump to hunk
+static int net_shaper_generic_pre(struct genl_info *info, int type)
+{
+	struct net_shaper_nl_ctx *ctx = (struct net_shaper_nl_ctx *)info->ctx;
+	int ret;
+
+	BUILD_BUG_ON(sizeof(*ctx) > sizeof(info->ctx));
+
+	ret = net_shaper_ctx_setup(info, type, ctx);
+	if (ret)
+		return ret;
+
+	return 0;
There seems to be no extra code here at the end of the series so:

	return net_shaper_ctx_setup(info, type, ctx);

With those nits addressed:

Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Thread (32 messages) 32 messages, 2 authors, last reply 2024-09-06
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help