Article View: linux.kernel.netdev
Article #13230Re: [PATCH net-next 2/2] net sysfs: simplify creating empty wireless directory
From: netdev-bot+sashiko
Date: Mon, 09 Nov 2026 13:48
Date: Mon, 09 Nov 2026 13:48
72 lines
10547 bytes
10547 bytes
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
Technical Details
Message-ID:
<179423212421.994134.15099883810255197611@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359341-linux-kernel-netdev=dewy.ruReferences:
<675f4353-125e-4168-a617-c0d1fb519045@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359341-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 2/2] net sysfs: simplify creating empty wireless directory Date: Mon, 09 Nov 2026 13:48:44 +0000 Organization: Usenet Network Message-ID: <179423212421.994134.15099883810255197611@kernel.org> References: <675f4353-125e-4168-a617-c0d1fb519045@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="372543"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:BE9WYgQC2fC9ue8WyCiBqb+47pA= sha256:L7M7sTXDxUuslnO4yU2AD/Snhz47eHN0L1xBMuWH9Tg= sha1:8SrkQdOu9ybtb/M4n+XduPp9OWE= sha256:aRxW+aWXk+VeaN38/92LWfDeaad9VYYdkbvTumFBJ6o= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 51A081137DB; Mon, 9 Nov 2026 17:05:29 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o9p-mSwOVvcY; Mon, 9 Nov 2026 17:05:25 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-359341-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 581E9113780; Mon, 9 Nov 2026 17:05:17 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 29339A5CD5; Mon, 9 Nov 2026 13:49:05 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794232126; b=k5gFAm6V/tJs10TEQ6wIzcfspXnUnabXq+MZFnLhVcPapKievS2LfmwSK9+tE6fzNxLB 0obORtrCHP4HG5/54tsHDk8dtEJXllJ6ErgrbJw1CoyCLaXYw5CLE4LbJIlnODSMoJw2P avjy8d2JiuPSmZ60FIppywsbEJrezkpIGTAlfD97+RnzSQadQZlFbtyrhB8ObBAIZkCw3 WzrwOYuN7h0rl04jAIWb+6YEiCR5S3oiTC50xBmjea/XABcJNgDYFOrSApWFXrfThIlAD QIKwyrC3xjBPUHL7judxObYttrrXEXUniQub4yQTq/ZqvvhLQJIai3fH0K6yTCRE4qQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794232126; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=Y2/1OzJ1M6XNzCIIpXMSbzY6xvvbz9HaNJEuYUnzV7s=; b=oEPSQjTGk2ukP+NdwDGpChQYbhPAXoOS+L+fIuQIpo0Agk5gFdTBrih6y2ZOgtanTRKP VM0GlBFAfixKw060/fLJU/BDMwmoL96JTIV+J258S1Xnd0KAfdtckm7jcCu9FcsDjNLwS PLojx6lsnrr7zmrPpO9AIC8uISDOsxvKnLFaEuDu5q1bD7W+3A5fyIXcFStYqiKQJ8mYl mX89zbw3WQfJpUxdSbfI6ElbFaEeTBCvGIVsqYJbmai6QlNenNOheHTAGuqJiK2HrYKvT POX/ksNfIEjmdal3ME+MyvHsBNBz45gDyz0LtKOYZ+VOI+IUk4gFk/Oz/wVZpk8YDRA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=B64GPlDA; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2548606A33A; Mon, 9 Nov 2026 13:48:46 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=B64GPlDA X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794232126; b=kquFp1nPuKd+jSWv1X1h50TC6Cn1OJ1qKY0hi1tWEosXUHRDqXCiXlSApcnLiouug8RO g41fZxNEaIo8r8bpswnwOOPc+3KLmqzz1p5b05jwHOPwe6DsF/q7TcYlblr3+NLX9aTux 1P000NhPBU04StS6EqojL0vB5sY41twtdwivzL2Vyn1EQ4StuefskIIwFr+jNBlBFNwC7 RCiRTyzEBnaFh4tBDXWczbVLRoPIsp1R5msv7MLd9Hv8T6gLN1gxfQlgj2QNEXDEb5SpX CudU2cAn9eb2EdxUGLYyZUw2VFQYZ7QoJi1/68IJSe/grnO8hGGA4B5fcW0NcfQXOjw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794232126; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=Y2/1OzJ1M6XNzCIIpXMSbzY6xvvbz9HaNJEuYUnzV7s=; b=EbHQNVxdUuuN9BDLanelazsXrgPaKIAl1tEwYKcFoNHz3h8UlAKWMN0LFRf+U9BL9ScO BcErjJGBQrXRnPUESLmizDaIHjwoH2j5+kgAMCBqOzwRHTEB/5sGUa/M8nbal+3oOxTin Nd5VOcYm+PU+AgXehWMWY4TwXlnkWOVVg/wlbpkF4Xrrm6rET8merGMmC48P3CyA/gnjH 1T9araImt9E4IW10p0BObMZSESw5FTC8zxDgLJQqJS3jqS3uvZ7i6mJnJCvYsj/3S9ZH0 THw21g45D1u7Pc9JJQmKDxOspWZl4wgMNo9qi+c2FOezs2d+H8faVzEszx0QXfTmesQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=B64GPlDA; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B57AC606A334; Mon, 9 Nov 2026 13:48:45 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC29A1F008A1; Mon, 9 Nov 2026 13:48:44 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794232125; bh=Y2/1OzJ1M6XNzCIIpXMSbzY6xvvbz9HaNJEuYUnzV7s=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=B64GPlDACV6LSNHTN2w8BkRRqH3wYjHfU9sD4mxUWD9lxu7lD2sF1HIOM637Dq87g rOSnZ1v/Rq3q3ZdfHyI8rc1l/M+mDhM0DHiPlOI7aS+V5KlZXAjpBOljurYQedv6Dw NIYbeDvKuMFex29rTthdm7CwStHfAdesU7OhQK/p2JcAf6QRmHZhLziYRezM7eH/Yv KUnz3ko7L8+m7ssx0Ce1EzZ1nWoqpEyO88TXaBEhF/LNUDk9zWN8VOl/7kwW40O9YR GVJfn7HvwuVf2rzUaRPs/l04vej59oP8VFHGfaGh0ZvSR6OqjdO7O23fA0WlBUfbu5 PDbdx8G6gN/XQ== X-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 X-In-Reply-To: <675f4353-125e-4168-a617-c0d1fb519045@gmail.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list