Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI: Constify slot attributes
Date: Thu, 14 May 2026 18:43:57 +0000	[thread overview]
Message-ID: <20260514184357.B7FB1C2BCB7@smtp.kernel.org> (raw)
In-Reply-To: <20260514-sysfs-const-pci-hotplug-v1-2-3b0b6c6f7481@weissschuh.net>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Incomplete constification: missed `zpci_slot_attr_uid` in `arch/s390/pci/pci_sysfs.c`.
--

commit 81d437e9bb503bcf5cbb6fdfb3f55cfe7eaf8cde
Author: Thomas Weißschuh <linux@weissschuh.net>

PCI: Constify slot attributes
    
The attribute struct are never modified, mark them as const.

> diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
> index 6d5cd37bfb1e7..7929bb87b1959 100644
> --- a/drivers/pci/slot.c
> +++ b/drivers/pci/slot.c

[ ... ]

> @@ -93,14 +93,14 @@ static void pci_slot_release(struct kobject *kobj)
>  	kfree(slot);
>  }
>  
> -static struct pci_slot_attribute pci_slot_attr_address =
> +static const struct pci_slot_attribute pci_slot_attr_address =
>  	__ATTR(address, S_IRUGO, address_read_file, NULL);
> -static struct pci_slot_attribute pci_slot_attr_max_speed =
> +static const struct pci_slot_attribute pci_slot_attr_max_speed =
>  	__ATTR(max_bus_speed, S_IRUGO, max_speed_read_file, NULL);
> -static struct pci_slot_attribute pci_slot_attr_cur_speed =
> +static const struct pci_slot_attribute pci_slot_attr_cur_speed =
>  	__ATTR(cur_bus_speed, S_IRUGO, cur_speed_read_file, NULL);

Since this constifies the core PCI slot attributes, should the s390
architecture-specific attributes also be marked as const?

Looking at arch/s390/pci/pci_sysfs.c, it defines a struct pci_slot_attribute
and an attribute array that appear to be missed in this patch:

arch/s390/pci/pci_sysfs.c:
static struct pci_slot_attribute zpci_slot_attr_uid =
	__ATTR(uid, 0444, zpci_uid_slot_show, NULL);

static struct attribute *zpci_slot_attrs[] = {
	&zpci_slot_attr_uid.attr,
	NULL,
};

Could these be updated to const as well?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260514-sysfs-const-pci-hotplug-v1-0-3b0b6c6f7481@weissschuh.net?part=2

  reply	other threads:[~2026-05-14 18:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14  6:30 [PATCH 0/2] PCI: Manage hotplug attributes through group and make slot attributes const Thomas Weißschuh
2026-05-14  6:31 ` [PATCH 1/2] PCI: hotplug: Manage hotplug slot attributes as group Thomas Weißschuh
2026-05-14  6:31 ` [PATCH 2/2] PCI: Constify slot attributes Thomas Weißschuh
2026-05-14 18:43   ` sashiko-bot [this message]
2026-05-14  6:42 ` [PATCH 0/2] PCI: Manage hotplug attributes through group and make slot attributes const Krzysztof Wilczyński

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=20260514184357.B7FB1C2BCB7@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=sashiko-reviews@lists.linux.dev \
    /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