Thread (1 message) 1 message, 1 author, 2024-11-07

Re: [PATCH v2 05/10] sysfs: treewide: constify attribute callback of bin_is_visible()

From: Pratyush Yadav <pratyush@kernel.org>
Date: 2024-11-07 17:20:45
Also in: amd-gfx, dri-devel, linux-alpha, linux-cxl, linux-hyperv, linux-pci, linux-rdma, linux-scsi, linux-usb, lkml, platform-driver-x86

On Sun, Nov 03 2024, Thomas Weißschuh wrote:
quoted hunk
The is_bin_visible() callbacks should not modify the struct
bin_attribute passed as argument.
Enforce this by marking the argument as const.

As there are not many callback implementers perform this change
throughout the tree at once.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
diff --git a/drivers/mtd/spi-nor/sysfs.c b/drivers/mtd/spi-nor/sysfs.c
index 96064e4babf01f6950c81586764386e7671cbf97..5e9eb268073d18e0a46089000f18a3200b4bf13d 100644
--- a/drivers/mtd/spi-nor/sysfs.c
+++ b/drivers/mtd/spi-nor/sysfs.c
@@ -87,7 +87,7 @@ static umode_t spi_nor_sysfs_is_visible(struct kobject *kobj,
 }
 
 static umode_t spi_nor_sysfs_is_bin_visible(struct kobject *kobj,
-					    struct bin_attribute *attr, int n)
+					    const struct bin_attribute *attr, int n)
Acked-by: Pratyush Yadav <pratyush@kernel.org> # for spi-nor
 {
 	struct spi_device *spi = to_spi_device(kobj_to_dev(kobj));
 	struct spi_mem *spimem = spi_get_drvdata(spi);
-- 
Regards,
Pratyush Yadav
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help