diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2024-11-03 17:03:35 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-11-05 14:00:28 +0100 |
commit | 94a20fb9af16417ab5fd17bcde3d906926f15ef6 (patch) | |
tree | 9138c283d7bf7ba778b61c4dcc31052b09b36d1a /drivers/pci/p2pdma.c | |
parent | b626816fdd7f9beb841856ba049396cff46e99aa (diff) | |
download | linux-94a20fb9af16417ab5fd17bcde3d906926f15ef6.tar.gz linux-94a20fb9af16417ab5fd17bcde3d906926f15ef6.tar.bz2 linux-94a20fb9af16417ab5fd17bcde3d906926f15ef6.zip |
sysfs: treewide: constify attribute callback of bin_attribute::mmap()
The mmap() 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>
Acked-by: Andrew Donnellan <ajd@linux.ibm.com> # ocxl
Acked-by: Krzysztof Wilczyński <kw@linux.com>
Link: https://lore.kernel.org/r/20241103-sysfs-const-bin_attr-v2-6-71110628844c@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pci/p2pdma.c')
-rw-r--r-- | drivers/pci/p2pdma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c index 4f47a13cb500..7abd4f546d3c 100644 --- a/drivers/pci/p2pdma.c +++ b/drivers/pci/p2pdma.c @@ -90,7 +90,7 @@ static ssize_t published_show(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR_RO(published); static int p2pmem_alloc_mmap(struct file *filp, struct kobject *kobj, - struct bin_attribute *attr, struct vm_area_struct *vma) + const struct bin_attribute *attr, struct vm_area_struct *vma) { struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj)); size_t len = vma->vm_end - vma->vm_start; |