From: Bjorn Helgaas <helgaas@kernel.org>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI/sysfs: Make kobj_type structure constant
Date: Thu, 16 Feb 2023 12:01:54 -0600 [thread overview]
Message-ID: <20230216180154.GA3322464@bhelgaas> (raw)
In-Reply-To: <20230216-kobj_type-pci-v1-1-46a63c8612b5@weissschuh.net>
On Thu, Feb 16, 2023 at 01:12:25AM +0000, 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>
Applied to pci/misc for v6.13, thanks, Thomas!
> ---
> drivers/pci/slot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
> index a0c67191a8b9..0f87cade10f7 100644
> --- a/drivers/pci/slot.c
> +++ b/drivers/pci/slot.c
> @@ -98,7 +98,7 @@ static struct attribute *pci_slot_default_attrs[] = {
> };
> ATTRIBUTE_GROUPS(pci_slot_default);
>
> -static struct kobj_type pci_slot_ktype = {
> +static const struct kobj_type pci_slot_ktype = {
> .sysfs_ops = &pci_slot_sysfs_ops,
> .release = &pci_slot_release,
> .default_groups = pci_slot_default_groups,
>
> ---
> base-commit: 033c40a89f55525139fd5b6342281b09b97d05bf
> change-id: 20230216-kobj_type-pci-56120c1c0bcb
>
> Best regards,
> --
> Thomas Weißschuh <linux@weissschuh.net>
>
prev parent reply other threads:[~2023-02-16 18:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 1:12 [PATCH] PCI/sysfs: Make kobj_type structure constant Thomas Weißschuh
2023-02-16 18:01 ` Bjorn Helgaas [this message]
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=20230216180154.GA3322464@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@weissschuh.net \
/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