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

From: Jakub Kicinski <[email-masked]>
Date: Tue, 6 Feb 2024 18:42:02 -0800

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