public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] PCI: Constify 'struct bin_attribute'
@ 2024-12-02 19:02 Thomas Weißschuh
  2024-12-02 19:02 ` [PATCH 1/4] PCI/sysfs: " Thomas Weißschuh
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Thomas Weißschuh @ 2024-12-02 19:02 UTC (permalink / raw)
  To: Bjorn Helgaas, Logan Gunthorpe, Rafael J. Wysocki, Len Brown
  Cc: linux-pci, linux-kernel, linux-acpi, Thomas Weißschuh

The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.

The usage of read_new/write_new/bin_attrs_new is a transition mechanism
and will be reverted after the transition is complete.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (4):
      PCI/sysfs: Constify 'struct bin_attribute'
      PCI/VPD: Constify 'struct bin_attribute'
      PCI/P2PDMA: Constify 'struct bin_attribute'
      PCI/ACPI: Constify 'struct bin_attribute'

 drivers/pci/hotplug/acpiphp_ibm.c |  6 +++---
 drivers/pci/p2pdma.c              |  6 +++---
 drivers/pci/pci-sysfs.c           | 42 +++++++++++++++++++--------------------
 drivers/pci/vpd.c                 | 14 ++++++-------
 4 files changed, 34 insertions(+), 34 deletions(-)
---
base-commit: e70140ba0d2b1a30467d4af6bcfe761327b9ec95
change-id: 20241201-sysfs-const-bin_attr-pci-be2425e1a856

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] PCI/sysfs: Constify 'struct bin_attribute'
  2024-12-02 19:02 [PATCH 0/4] PCI: Constify 'struct bin_attribute' Thomas Weißschuh
@ 2024-12-02 19:02 ` Thomas Weißschuh
  2024-12-02 19:02 ` [PATCH 2/4] PCI/VPD: " Thomas Weißschuh
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Thomas Weißschuh @ 2024-12-02 19:02 UTC (permalink / raw)
  To: Bjorn Helgaas, Logan Gunthorpe, Rafael J. Wysocki, Len Brown
  Cc: linux-pci, linux-kernel, linux-acpi, Thomas Weißschuh

The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/pci/pci-sysfs.c | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 7679d75d71e534d4f3d1e1b4ae6c5ee5f8518ea1..6f1bb7514efb3281281fc7d9b9f1f8f9d501b969 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -694,7 +694,7 @@ static ssize_t boot_vga_show(struct device *dev, struct device_attribute *attr,
 static DEVICE_ATTR_RO(boot_vga);
 
 static ssize_t pci_read_config(struct file *filp, struct kobject *kobj,
-			       struct bin_attribute *bin_attr, char *buf,
+			       const struct bin_attribute *bin_attr, char *buf,
 			       loff_t off, size_t count)
 {
 	struct pci_dev *dev = to_pci_dev(kobj_to_dev(kobj));
@@ -769,7 +769,7 @@ static ssize_t pci_read_config(struct file *filp, struct kobject *kobj,
 }
 
 static ssize_t pci_write_config(struct file *filp, struct kobject *kobj,
-				struct bin_attribute *bin_attr, char *buf,
+				const struct bin_attribute *bin_attr, char *buf,
 				loff_t off, size_t count)
 {
 	struct pci_dev *dev = to_pci_dev(kobj_to_dev(kobj));
@@ -837,9 +837,9 @@ static ssize_t pci_write_config(struct file *filp, struct kobject *kobj,
 
 	return count;
 }
-static BIN_ATTR(config, 0644, pci_read_config, pci_write_config, 0);
+static const BIN_ATTR(config, 0644, pci_read_config, pci_write_config, 0);
 
-static struct bin_attribute *pci_dev_config_attrs[] = {
+static const struct bin_attribute *const pci_dev_config_attrs[] = {
 	&bin_attr_config,
 	NULL,
 };
@@ -856,7 +856,7 @@ static size_t pci_dev_config_attr_bin_size(struct kobject *kobj,
 }
 
 static const struct attribute_group pci_dev_config_attr_group = {
-	.bin_attrs = pci_dev_config_attrs,
+	.bin_attrs_new = pci_dev_config_attrs,
 	.bin_size = pci_dev_config_attr_bin_size,
 };
 
@@ -887,8 +887,8 @@ pci_llseek_resource(struct file *filep,
  * callback routine (pci_legacy_read).
  */
 static ssize_t pci_read_legacy_io(struct file *filp, struct kobject *kobj,
-				  struct bin_attribute *bin_attr, char *buf,
-				  loff_t off, size_t count)
+				  const struct bin_attribute *bin_attr,
+				  char *buf, loff_t off, size_t count)
 {
 	struct pci_bus *bus = to_pci_bus(kobj_to_dev(kobj));
 
@@ -912,8 +912,8 @@ static ssize_t pci_read_legacy_io(struct file *filp, struct kobject *kobj,
  * callback routine (pci_legacy_write).
  */
 static ssize_t pci_write_legacy_io(struct file *filp, struct kobject *kobj,
-				   struct bin_attribute *bin_attr, char *buf,
-				   loff_t off, size_t count)
+				   const struct bin_attribute *bin_attr,
+				   char *buf, loff_t off, size_t count)
 {
 	struct pci_bus *bus = to_pci_bus(kobj_to_dev(kobj));
 
@@ -1003,8 +1003,8 @@ void pci_create_legacy_files(struct pci_bus *b)
 	b->legacy_io->attr.name = "legacy_io";
 	b->legacy_io->size = 0xffff;
 	b->legacy_io->attr.mode = 0600;
-	b->legacy_io->read = pci_read_legacy_io;
-	b->legacy_io->write = pci_write_legacy_io;
+	b->legacy_io->read_new = pci_read_legacy_io;
+	b->legacy_io->write_new = pci_write_legacy_io;
 	/* See pci_create_attr() for motivation */
 	b->legacy_io->llseek = pci_llseek_resource;
 	b->legacy_io->mmap = pci_mmap_legacy_io;
@@ -1099,7 +1099,7 @@ static int pci_mmap_resource_wc(struct file *filp, struct kobject *kobj,
 }
 
 static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj,
-			       struct bin_attribute *attr, char *buf,
+			       const struct bin_attribute *attr, char *buf,
 			       loff_t off, size_t count, bool write)
 {
 #ifdef CONFIG_HAS_IOPORT
@@ -1142,14 +1142,14 @@ static ssize_t pci_resource_io(struct file *filp, struct kobject *kobj,
 }
 
 static ssize_t pci_read_resource_io(struct file *filp, struct kobject *kobj,
-				    struct bin_attribute *attr, char *buf,
+				    const struct bin_attribute *attr, char *buf,
 				    loff_t off, size_t count)
 {
 	return pci_resource_io(filp, kobj, attr, buf, off, count, false);
 }
 
 static ssize_t pci_write_resource_io(struct file *filp, struct kobject *kobj,
-				     struct bin_attribute *attr, char *buf,
+				     const struct bin_attribute *attr, char *buf,
 				     loff_t off, size_t count)
 {
 	int ret;
@@ -1210,8 +1210,8 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine)
 	} else {
 		sprintf(res_attr_name, "resource%d", num);
 		if (pci_resource_flags(pdev, num) & IORESOURCE_IO) {
-			res_attr->read = pci_read_resource_io;
-			res_attr->write = pci_write_resource_io;
+			res_attr->read_new = pci_read_resource_io;
+			res_attr->write_new = pci_write_resource_io;
 			if (arch_can_pci_mmap_io())
 				res_attr->mmap = pci_mmap_resource_uc;
 		} else {
@@ -1292,7 +1292,7 @@ void __weak pci_remove_resource_files(struct pci_dev *dev) { return; }
  * writing anything except 0 enables it
  */
 static ssize_t pci_write_rom(struct file *filp, struct kobject *kobj,
-			     struct bin_attribute *bin_attr, char *buf,
+			     const struct bin_attribute *bin_attr, char *buf,
 			     loff_t off, size_t count)
 {
 	struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
@@ -1318,7 +1318,7 @@ static ssize_t pci_write_rom(struct file *filp, struct kobject *kobj,
  * device corresponding to @kobj.
  */
 static ssize_t pci_read_rom(struct file *filp, struct kobject *kobj,
-			    struct bin_attribute *bin_attr, char *buf,
+			    const struct bin_attribute *bin_attr, char *buf,
 			    loff_t off, size_t count)
 {
 	struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
@@ -1344,9 +1344,9 @@ static ssize_t pci_read_rom(struct file *filp, struct kobject *kobj,
 
 	return count;
 }
-static BIN_ATTR(rom, 0600, pci_read_rom, pci_write_rom, 0);
+static const BIN_ATTR(rom, 0600, pci_read_rom, pci_write_rom, 0);
 
-static struct bin_attribute *pci_dev_rom_attrs[] = {
+static const struct bin_attribute *const pci_dev_rom_attrs[] = {
 	&bin_attr_rom,
 	NULL,
 };
@@ -1372,7 +1372,7 @@ static size_t pci_dev_rom_attr_bin_size(struct kobject *kobj,
 }
 
 static const struct attribute_group pci_dev_rom_attr_group = {
-	.bin_attrs = pci_dev_rom_attrs,
+	.bin_attrs_new = pci_dev_rom_attrs,
 	.is_bin_visible = pci_dev_rom_attr_is_visible,
 	.bin_size = pci_dev_rom_attr_bin_size,
 };

-- 
2.47.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] PCI/VPD: Constify 'struct bin_attribute'
  2024-12-02 19:02 [PATCH 0/4] PCI: Constify 'struct bin_attribute' Thomas Weißschuh
  2024-12-02 19:02 ` [PATCH 1/4] PCI/sysfs: " Thomas Weißschuh
@ 2024-12-02 19:02 ` Thomas Weißschuh
  2024-12-02 19:02 ` [PATCH 3/4] PCI/P2PDMA: " Thomas Weißschuh
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Thomas Weißschuh @ 2024-12-02 19:02 UTC (permalink / raw)
  To: Bjorn Helgaas, Logan Gunthorpe, Rafael J. Wysocki, Len Brown
  Cc: linux-pci, linux-kernel, linux-acpi, Thomas Weißschuh

The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/pci/vpd.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c
index a469bcbc0da7f7677485c7f999f8dfb58b8ae8a3..3d29b2602d0fb760b81c374036a506a4ddb4b281 100644
--- a/drivers/pci/vpd.c
+++ b/drivers/pci/vpd.c
@@ -271,8 +271,8 @@ void pci_vpd_init(struct pci_dev *dev)
 }
 
 static ssize_t vpd_read(struct file *filp, struct kobject *kobj,
-			struct bin_attribute *bin_attr, char *buf, loff_t off,
-			size_t count)
+			const struct bin_attribute *bin_attr, char *buf,
+			loff_t off, size_t count)
 {
 	struct pci_dev *dev = to_pci_dev(kobj_to_dev(kobj));
 	struct pci_dev *vpd_dev = dev;
@@ -295,8 +295,8 @@ static ssize_t vpd_read(struct file *filp, struct kobject *kobj,
 }
 
 static ssize_t vpd_write(struct file *filp, struct kobject *kobj,
-			 struct bin_attribute *bin_attr, char *buf, loff_t off,
-			 size_t count)
+			 const struct bin_attribute *bin_attr, char *buf,
+			 loff_t off, size_t count)
 {
 	struct pci_dev *dev = to_pci_dev(kobj_to_dev(kobj));
 	struct pci_dev *vpd_dev = dev;
@@ -317,9 +317,9 @@ static ssize_t vpd_write(struct file *filp, struct kobject *kobj,
 
 	return ret;
 }
-static BIN_ATTR(vpd, 0600, vpd_read, vpd_write, 0);
+static const BIN_ATTR(vpd, 0600, vpd_read, vpd_write, 0);
 
-static struct bin_attribute *vpd_attrs[] = {
+static const struct bin_attribute *const vpd_attrs[] = {
 	&bin_attr_vpd,
 	NULL,
 };
@@ -336,7 +336,7 @@ static umode_t vpd_attr_is_visible(struct kobject *kobj,
 }
 
 const struct attribute_group pci_dev_vpd_attr_group = {
-	.bin_attrs = vpd_attrs,
+	.bin_attrs_new = vpd_attrs,
 	.is_bin_visible = vpd_attr_is_visible,
 };
 

-- 
2.47.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] PCI/P2PDMA: Constify 'struct bin_attribute'
  2024-12-02 19:02 [PATCH 0/4] PCI: Constify 'struct bin_attribute' Thomas Weißschuh
  2024-12-02 19:02 ` [PATCH 1/4] PCI/sysfs: " Thomas Weißschuh
  2024-12-02 19:02 ` [PATCH 2/4] PCI/VPD: " Thomas Weißschuh
@ 2024-12-02 19:02 ` Thomas Weißschuh
  2024-12-02 19:07   ` Logan Gunthorpe
  2024-12-02 19:03 ` [PATCH 4/4] PCI/ACPI: " Thomas Weißschuh
  2024-12-03 21:32 ` [PATCH 0/4] PCI: " Bjorn Helgaas
  4 siblings, 1 reply; 8+ messages in thread
From: Thomas Weißschuh @ 2024-12-02 19:02 UTC (permalink / raw)
  To: Bjorn Helgaas, Logan Gunthorpe, Rafael J. Wysocki, Len Brown
  Cc: linux-pci, linux-kernel, linux-acpi, Thomas Weißschuh

The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/pci/p2pdma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 7abd4f546d3c071f31e622d881f5c5ac3e4de55e..0cb7e0aaba0ebdb8d0d235428a03a113cde7b390 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -161,7 +161,7 @@ static int p2pmem_alloc_mmap(struct file *filp, struct kobject *kobj,
 	return ret;
 }
 
-static struct bin_attribute p2pmem_alloc_attr = {
+static const struct bin_attribute p2pmem_alloc_attr = {
 	.attr = { .name = "allocate", .mode = 0660 },
 	.mmap = p2pmem_alloc_mmap,
 	/*
@@ -180,14 +180,14 @@ static struct attribute *p2pmem_attrs[] = {
 	NULL,
 };
 
-static struct bin_attribute *p2pmem_bin_attrs[] = {
+static const struct bin_attribute *const p2pmem_bin_attrs[] = {
 	&p2pmem_alloc_attr,
 	NULL,
 };
 
 static const struct attribute_group p2pmem_group = {
 	.attrs = p2pmem_attrs,
-	.bin_attrs = p2pmem_bin_attrs,
+	.bin_attrs_new = p2pmem_bin_attrs,
 	.name = "p2pmem",
 };
 

-- 
2.47.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] PCI/ACPI: Constify 'struct bin_attribute'
  2024-12-02 19:02 [PATCH 0/4] PCI: Constify 'struct bin_attribute' Thomas Weißschuh
                   ` (2 preceding siblings ...)
  2024-12-02 19:02 ` [PATCH 3/4] PCI/P2PDMA: " Thomas Weißschuh
@ 2024-12-02 19:03 ` Thomas Weißschuh
  2024-12-10 18:23   ` Rafael J. Wysocki
  2024-12-03 21:32 ` [PATCH 0/4] PCI: " Bjorn Helgaas
  4 siblings, 1 reply; 8+ messages in thread
From: Thomas Weißschuh @ 2024-12-02 19:03 UTC (permalink / raw)
  To: Bjorn Helgaas, Logan Gunthorpe, Rafael J. Wysocki, Len Brown
  Cc: linux-pci, linux-kernel, linux-acpi, Thomas Weißschuh

The sysfs core now allows instances of 'struct bin_attribute' to be
moved into read-only memory. Make use of that to protect them against
accidental or malicious modifications.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/pci/hotplug/acpiphp_ibm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index 8f3a0a33f362bc60ba012419b865b8821c075531..b3aa34e3a4a29417bd694273779dc356be284f1d 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -84,7 +84,7 @@ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status);
 static void ibm_handle_events(acpi_handle handle, u32 event, void *context);
 static int ibm_get_table_from_acpi(char **bufp);
 static ssize_t ibm_read_apci_table(struct file *filp, struct kobject *kobj,
-				   struct bin_attribute *bin_attr,
+				   const struct bin_attribute *bin_attr,
 				   char *buffer, loff_t pos, size_t size);
 static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
 		u32 lvl, void *context, void **rv);
@@ -98,7 +98,7 @@ static struct bin_attribute ibm_apci_table_attr __ro_after_init = {
 		    .name = "apci_table",
 		    .mode = S_IRUGO,
 	    },
-	    .read = ibm_read_apci_table,
+	    .read_new = ibm_read_apci_table,
 	    .write = NULL,
 };
 static struct acpiphp_attention_info ibm_attention_info =
@@ -353,7 +353,7 @@ static int ibm_get_table_from_acpi(char **bufp)
  * our solution is to only allow reading the table in all at once.
  */
 static ssize_t ibm_read_apci_table(struct file *filp, struct kobject *kobj,
-				   struct bin_attribute *bin_attr,
+				   const struct bin_attribute *bin_attr,
 				   char *buffer, loff_t pos, size_t size)
 {
 	int bytes_read = -EINVAL;

-- 
2.47.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/4] PCI/P2PDMA: Constify 'struct bin_attribute'
  2024-12-02 19:02 ` [PATCH 3/4] PCI/P2PDMA: " Thomas Weißschuh
@ 2024-12-02 19:07   ` Logan Gunthorpe
  0 siblings, 0 replies; 8+ messages in thread
From: Logan Gunthorpe @ 2024-12-02 19:07 UTC (permalink / raw)
  To: Thomas Weißschuh, Bjorn Helgaas, Rafael J. Wysocki,
	Len Brown
  Cc: linux-pci, linux-kernel, linux-acpi



On 2024-12-02 12:02, Thomas Weißschuh wrote:
> The sysfs core now allows instances of 'struct bin_attribute' to be
> moved into read-only memory. Make use of that to protect them against
> accidental or malicious modifications.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Looks good to me, thanks!

Logan Gunthorpe <logang@deltatee.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] PCI: Constify 'struct bin_attribute'
  2024-12-02 19:02 [PATCH 0/4] PCI: Constify 'struct bin_attribute' Thomas Weißschuh
                   ` (3 preceding siblings ...)
  2024-12-02 19:03 ` [PATCH 4/4] PCI/ACPI: " Thomas Weißschuh
@ 2024-12-03 21:32 ` Bjorn Helgaas
  4 siblings, 0 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2024-12-03 21:32 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Bjorn Helgaas, Logan Gunthorpe, Rafael J. Wysocki, Len Brown,
	linux-pci, linux-kernel, linux-acpi

On Mon, Dec 02, 2024 at 08:02:56PM +0100, Thomas Weißschuh wrote:
> The sysfs core now allows instances of 'struct bin_attribute' to be
> moved into read-only memory. Make use of that to protect them against
> accidental or malicious modifications.
> 
> The usage of read_new/write_new/bin_attrs_new is a transition mechanism
> and will be reverted after the transition is complete.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Applied to pci/constify for v6.14, thanks.

Logan, I converted your response at
https://lore.kernel.org/all/003d2d13-13be-4f05-80f8-61e14ddb9c83@deltatee.com/
to include "Reviewed-by".

Let me know if that's not what you intended.

> ---
> Thomas Weißschuh (4):
>       PCI/sysfs: Constify 'struct bin_attribute'
>       PCI/VPD: Constify 'struct bin_attribute'
>       PCI/P2PDMA: Constify 'struct bin_attribute'
>       PCI/ACPI: Constify 'struct bin_attribute'
> 
>  drivers/pci/hotplug/acpiphp_ibm.c |  6 +++---
>  drivers/pci/p2pdma.c              |  6 +++---
>  drivers/pci/pci-sysfs.c           | 42 +++++++++++++++++++--------------------
>  drivers/pci/vpd.c                 | 14 ++++++-------
>  4 files changed, 34 insertions(+), 34 deletions(-)
> ---
> base-commit: e70140ba0d2b1a30467d4af6bcfe761327b9ec95
> change-id: 20241201-sysfs-const-bin_attr-pci-be2425e1a856
> 
> Best regards,
> -- 
> Thomas Weißschuh <linux@weissschuh.net>
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] PCI/ACPI: Constify 'struct bin_attribute'
  2024-12-02 19:03 ` [PATCH 4/4] PCI/ACPI: " Thomas Weißschuh
@ 2024-12-10 18:23   ` Rafael J. Wysocki
  0 siblings, 0 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2024-12-10 18:23 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: Bjorn Helgaas, Logan Gunthorpe, Rafael J. Wysocki, Len Brown,
	linux-pci, linux-kernel, linux-acpi

On Mon, Dec 2, 2024 at 8:03 PM Thomas Weißschuh <linux@weissschuh.net> wrote:
>
> The sysfs core now allows instances of 'struct bin_attribute' to be
> moved into read-only memory. Make use of that to protect them against
> accidental or malicious modifications.
>
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

> ---
>  drivers/pci/hotplug/acpiphp_ibm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
> index 8f3a0a33f362bc60ba012419b865b8821c075531..b3aa34e3a4a29417bd694273779dc356be284f1d 100644
> --- a/drivers/pci/hotplug/acpiphp_ibm.c
> +++ b/drivers/pci/hotplug/acpiphp_ibm.c
> @@ -84,7 +84,7 @@ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status);
>  static void ibm_handle_events(acpi_handle handle, u32 event, void *context);
>  static int ibm_get_table_from_acpi(char **bufp);
>  static ssize_t ibm_read_apci_table(struct file *filp, struct kobject *kobj,
> -                                  struct bin_attribute *bin_attr,
> +                                  const struct bin_attribute *bin_attr,
>                                    char *buffer, loff_t pos, size_t size);
>  static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
>                 u32 lvl, void *context, void **rv);
> @@ -98,7 +98,7 @@ static struct bin_attribute ibm_apci_table_attr __ro_after_init = {
>                     .name = "apci_table",
>                     .mode = S_IRUGO,
>             },
> -           .read = ibm_read_apci_table,
> +           .read_new = ibm_read_apci_table,
>             .write = NULL,
>  };
>  static struct acpiphp_attention_info ibm_attention_info =
> @@ -353,7 +353,7 @@ static int ibm_get_table_from_acpi(char **bufp)
>   * our solution is to only allow reading the table in all at once.
>   */
>  static ssize_t ibm_read_apci_table(struct file *filp, struct kobject *kobj,
> -                                  struct bin_attribute *bin_attr,
> +                                  const struct bin_attribute *bin_attr,
>                                    char *buffer, loff_t pos, size_t size)
>  {
>         int bytes_read = -EINVAL;
>
> --
> 2.47.1
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-12-10 18:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 19:02 [PATCH 0/4] PCI: Constify 'struct bin_attribute' Thomas Weißschuh
2024-12-02 19:02 ` [PATCH 1/4] PCI/sysfs: " Thomas Weißschuh
2024-12-02 19:02 ` [PATCH 2/4] PCI/VPD: " Thomas Weißschuh
2024-12-02 19:02 ` [PATCH 3/4] PCI/P2PDMA: " Thomas Weißschuh
2024-12-02 19:07   ` Logan Gunthorpe
2024-12-02 19:03 ` [PATCH 4/4] PCI/ACPI: " Thomas Weißschuh
2024-12-10 18:23   ` Rafael J. Wysocki
2024-12-03 21:32 ` [PATCH 0/4] PCI: " Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox