Thread (7 messages) 7 messages, 3 authors, 2024-02-07

Re: [PATCH v2 1/3] genetlink: Add per family bind/unbind callbacks

From: Jakub Kicinski <kuba@kernel.org>
Date: 2024-02-07 02:42:04
Also in: linux-pm

On Tue,  6 Feb 2024 14:36:03 +0100 Stanislaw Gruszka wrote:
+static void genl_unbind(struct net *net, int group)
+{
+	const struct genl_family *family;
+	unsigned int id;
+
+	down_read(&cb_lock);
+
+	idr_for_each_entry(&genl_fam_idr, family, id) {
+		const struct genl_multicast_group *grp;
+		int i;
+
+		if (family->n_mcgrps == 0)
+			continue;
+
+		i = group - family->mcgrp_offset;
+		if (i < 0 || i >= family->n_mcgrps)
+			continue;
+
+		grp = &family->mcgrps[i];
+
+		if (family->unbind)
+			family->unbind(i);
+
+		break;
Compiler says:

net/netlink/genetlink.c:1857:52: warning: variable ‘grp’ set but not used [-Wunused-but-set-variable]
 1857 |                 const struct genl_multicast_group *grp;
      |                                                    ^~~
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help