Thread (16 messages) 16 messages, 2 authors, 2020-10-02

Re: [PATCH 1/5] netlink: simplify netlink_policy_dump_start() prototype

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2020-10-02 20:02:07

On Fri, 2020-10-02 at 08:31 -0700, Jakub Kicinski wrote:
On Fri,  2 Oct 2020 11:09:40 +0200 Johannes Berg wrote:
quoted
From: Johannes Berg <redacted>

Since moving the call to this to a dump start() handler we no
longer need this to deal with being called after having been
called already. Since that is the preferred way of doing things
anyway, remove the code necessary for that and simply return
the pointer (or an ERR_PTR()).

Signed-off-by: Johannes Berg <redacted>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
quoted
-	return netlink_policy_dump_start(op.policy, op.maxattr, &ctx->state);
+	ctx->state = netlink_policy_dump_start(op.policy, op.maxattr);
+	if (IS_ERR(ctx->state))
+		return PTR_ERR(ctx->state);
+	return 0;
PTR_ERR_OR_ZERO()?
Hah! I didn't even know about that, thanks.

johannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help