Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: hkallweit1@gmail.com
Cc: davem@davemloft.net, andrew+netdev@lunn.ch, edumazet@google.com,
	kuba@kernel.org, horms@kernel.org, gregkh@linuxfoundation.org,
	rafael@kernel.org, dakr@kernel.org, johan@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	driver-core@lists.linux.dev
Subject: Re: [PATCH net-next 2/2] net sysfs: simplify creating empty wireless directory
Date: Mon, 09 Nov 2026 13:48:44 +0000	[thread overview]
Message-ID: <179423212421.994134.15099883810255197611@kernel.org> (raw)
In-Reply-To: <675f4353-125e-4168-a617-c0d1fb519045@gmail.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The kernel-doc for struct attribute_group in
  include/linux/sysfs.h (line 103) still says "@bin_attrs: ... Either…

--

net sysfs: simplify creating empty wireless directory

The patch removes the dummy wireless_attrs[] list from wireless_group in
net/core/net-sysfs.c. It relies on the earlier sysfs change that lets a
named attribute group with NULL attrs create an empty directory.

> diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
> index 5c0402389c6d1..f58b59e112620 100644
> --- a/net/core/net-sysfs.c
> +++ b/net/core/net-sysfs.c
> @@ -910,13 +910,8 @@ static const struct attribute_group netstat_group = {
>  	.attrs  = netstat_attrs,
>  };
>  
> -static struct attribute *wireless_attrs[] = {
> -	NULL
> -};
> -
>  static const struct attribute_group wireless_group = {
>  	.name = "wireless",
> -	.attrs = wireless_attrs,
>  };

[Severity: Low]
This isn't a bug, but should the kernel-doc for struct attribute_group be
updated along with this change?

After this patch, wireless_group has both .attrs and .bin_attrs set to NULL.
The comment above struct attribute_group in include/linux/sysfs.h still
says:

 * @attrs:	Pointer to NULL terminated list of attributes.
 * @bin_attrs:	Pointer to NULL terminated list of binary attributes.
 *		Either attrs or bin_attrs or both must be provided.

The new behaviour is only described by an inline comment in
internal_create_group() in fs/sysfs/group.c:

	/* If name is set w/o attributes, create an empty directory */
	if (!grp->name && !grp->attrs && !grp->bin_attrs) {

The paths wireless_group actually goes through (create_files(),
remove_files(), sysfs_group_attrs_change_owner()) all check for NULL attrs
and bin_attrs, so nothing goes wrong at runtime here. Other helpers do not
tolerate NULL attrs, though. For example, sysfs_merge_group() dereferences
grp->attrs without a NULL check:

	for ((i = 0, attr = grp->attrs); *attr && !error; (++i, ++attr))

The same applies to sysfs_unmerge_group().

Could the @attrs/@bin_attrs kernel-doc be changed to say that a named group
may leave both NULL to get an empty directory? Could it also say which
helpers still require attrs to be set? Neither this patch nor the earlier
"sysfs: facilitate creating an empty directory" patch updates the
documentation, and this patch is the first in-tree user of the new
behaviour.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/0a0a7987-abb2-49c8-bc16-3938233ae9c5%40gmail.com

  parent reply	other threads:[~2026-11-09 13:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 13:44 [PATCH net-next 0/2] sysfs: facilitate creating an empty directory Heiner Kallweit
2026-11-08 13:45 ` [PATCH net-next 1/2] " Heiner Kallweit
2026-11-08 14:06   ` Greg Kroah-Hartman
2026-11-09 13:48   ` netdev-bot+sashiko
2026-11-08 13:46 ` [PATCH net-next 2/2] net sysfs: simplify creating empty wireless directory Heiner Kallweit
2026-11-08 14:06   ` Greg Kroah-Hartman
2026-11-08 14:12     ` Heiner Kallweit
2026-11-08 14:21       ` Greg Kroah-Hartman
2026-11-08 16:02         ` Heiner Kallweit
2026-11-09 13:48   ` netdev-bot+sashiko [this message]
2026-11-08 16:12 ` [PATCH net-next 0/2] sysfs: facilitate creating an empty directory Heiner Kallweit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179423212421.994134.15099883810255197611@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=dakr@kernel.org \
    --cc=davem@davemloft.net \
    --cc=driver-core@lists.linux.dev \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=johan@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox