From: Simon Horman <horms@kernel.org>
To: Zijun Hu <zijun_hu@icloud.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Zijun Hu <quic_zijuhu@quicinc.com>
Subject: Re: [PATCH] net: sysfs: Fix weird usage of class's namespace relevant fields
Date: Fri, 6 Sep 2024 11:21:50 +0100 [thread overview]
Message-ID: <20240906102150.GD2097826@kernel.org> (raw)
In-Reply-To: <20240905-fix_class_ns-v1-1-88ecccc3517c@quicinc.com>
On Thu, Sep 05, 2024 at 07:35:38AM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
>
> Device class has two namespace relevant fields which are associated by
> the following usage:
>
> struct class {
> ...
> const struct kobj_ns_type_operations *ns_type;
> const void *(*namespace)(const struct device *dev);
> ...
> }
> if (dev->class && dev->class->ns_type)
> dev->class->namespace(dev);
>
> The usage looks weird since it checks @ns_type but calls namespace()
> it is found for all existing class definitions that the other filed is
> also assigned once one is assigned in current kernel tree, so fix this
> weird usage by checking @namespace to call namespace().
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
> driver-core tree has similar fix as shown below:
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-next&id=a169a663bfa8198f33a5c1002634cc89e5128025
Thanks,
I agree that this change is consistent with the one at the link above.
And that, given your explanation there and here, this change
makes sense.
Reviewed-by: Simon Horman <horms@kernel.org>
I don't think there is a need to repost because of this, but for future
reference, please keep in mind that patches like this - non bug fixes for
Networking code - should, in general, be targeted at net-next.
Subject: [PATCH net-next] ...
See: https://docs.kernel.org/process/maintainer-netdev.html
next prev parent reply other threads:[~2024-09-06 10:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 23:35 [PATCH] net: sysfs: Fix weird usage of class's namespace relevant fields Zijun Hu
2024-09-06 10:21 ` Simon Horman [this message]
2024-09-06 11:12 ` Zijun Hu
2024-09-09 9:40 ` patchwork-bot+netdevbpf
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=20240906102150.GD2097826@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_zijuhu@quicinc.com \
--cc=zijun_hu@icloud.com \
/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;
as well as URLs for NNTP newsgroup(s).