Re: [PATCH net-next v2 2/8] net: netconsole: move netconsole_target config_item to config_group

From: Simon Horman
Date: Fri Feb 02 2024 - 06:56:00 EST


On Fri, Jan 26, 2024 at 03:13:37PM -0800, Matthew Wood wrote:
> In order to support a nested userdata config_group in later patches,
> use a config_group for netconsole_target instead of a
> config_item. It's a no-op functionality-wise, since
> config_group maintains all features of a config_item via the cg_item
> member.
>
> Signed-off-by: Matthew Wood <thepacketgeek@xxxxxxxxx>
> ---
> drivers/net/netconsole.c | 61 ++++++++++++++++++++++------------------
> 1 file changed, 33 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c

..

> @@ -665,8 +669,9 @@ static struct config_item *make_netconsole_target(struct config_group *group,
> if (!strncmp(name, NETCONSOLE_PARAM_TARGET_PREFIX,
> strlen(NETCONSOLE_PARAM_TARGET_PREFIX))) {
> nt = find_cmdline_target(name);
> - if (nt)
> - return &nt->item;
> + if (nt) {
> + return &nt->group;
> + }

nit: no need for {} here.

> }
>
> nt = alloc_and_init();

..