bridge.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <razor@blackwall.org>
To: "Thomas Weißschuh" <linux@weissschuh.net>,
	"Roopa Prabhu" <roopa@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [Bridge] [PATCH net-next v2 1/2] net: bridge: make kobj_type structure constant
Date: Tue, 14 Feb 2023 10:40:52 +0200	[thread overview]
Message-ID: <0a255859-9ec1-c808-d7d5-3500a6c49386@blackwall.org> (raw)
In-Reply-To: <20230211-kobj_type-net-v2-1-013b59e59bf3@weissschuh.net>

On 14/02/2023 06:23, Thomas Weißschuh wrote:
> Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
> the driver core allows the usage of const struct kobj_type.
> 
> Take advantage of this to constify the structure definition to prevent
> modification at runtime.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
>  net/bridge/br_if.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
> index ad13b48e3e08..24f01ff113f0 100644
> --- a/net/bridge/br_if.c
> +++ b/net/bridge/br_if.c
> @@ -269,7 +269,7 @@ static void brport_get_ownership(const struct kobject *kobj, kuid_t *uid, kgid_t
>  	net_ns_get_ownership(dev_net(p->dev), uid, gid);
>  }
>  
> -static struct kobj_type brport_ktype = {
> +static const struct kobj_type brport_ktype = {
>  #ifdef CONFIG_SYSFS
>  	.sysfs_ops = &brport_sysfs_ops,
>  #endif
> 

Acked-by: Nikolay Aleksandrov <razor@blackwall.org>


  reply	other threads:[~2023-02-14  8:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  4:23 [Bridge] [PATCH net-next v2 0/2] net: make kobj_type structures constant Thomas Weißschuh
2023-02-14  4:23 ` [Bridge] [PATCH net-next v2 1/2] net: bridge: make kobj_type structure constant Thomas Weißschuh
2023-02-14  8:40   ` Nikolay Aleksandrov [this message]
2023-02-14  4:23 ` [Bridge] [PATCH net-next v2 2/2] net-sysfs: make kobj_type structures constant Thomas Weißschuh
2023-02-15  4:50 ` [Bridge] [PATCH net-next v2 0/2] net: " 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=0a255859-9ec1-c808-d7d5-3500a6c49386@blackwall.org \
    --to=razor@blackwall.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=roopa@nvidia.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 read-only IMAP folder(s) and NNTP newsgroup(s).