Skip to contentSkip to conversation

cdx: constify bin_attribute callback

PATCH In review Arnd Bergmann 2 participants 2 messages Nov 11, 2024 AMD cdx bus driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cdx: constify bin_attribute callback

From: Arnd Bergmann <[email protected]>

This one was missed in the treewide conversion:

drivers/cdx/cdx.c: In function 'cdx_create_res_attr':
drivers/cdx/cdx.c:773:24: error: assignment to 'int (*)(struct file *, struct kobject *, const struct bin_attribute *, struct vm_area_struct *)' from incompatible pointer type 'int (*)(struct file *, struct kobject *, struct bin_attribute *, struct vm_area_struct *)' [-Wincompatible-pointer-types]
773 | res_attr->mmap = cdx_mmap_resource;
| ^

Fixes 94a20fb9af16 ("sysfs: treewide: constify attribute callback of bin_attribute::mmap()")
---
 drivers/cdx/cdx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cdx/cdx.c +1 -1
index 07371cb653d3..316bd89a95ca 100644
@@ -707,7 +707,7 @@ static const struct vm_operations_struct cdx_phys_vm_ops = {
  * Return: true on success, false otherwise.
  */
 static int cdx_mmap_resource(struct file *fp, struct kobject *kobj,
-			     struct bin_attribute *attr,
+			     const struct bin_attribute *attr,
 			     struct vm_area_struct *vma)
 {
 	struct cdx_device *cdx_dev = to_cdx_device(kobj_to_dev(kobj));
Signature · 1 line
2.39.5
maintainer
#1 lore raw
Quoted 12 lines

From: Arnd Bergmann <[email protected]>

This one was missed in the treewide conversion:

drivers/cdx/cdx.c: In function 'cdx_create_res_attr':
drivers/cdx/cdx.c:773:24: error: assignment to 'int (*)(struct file *, struct kobject *, const struct bin_attribute *, struct vm_area_struct *)' from incompatible pointer type 'int (*)(struct file *, struct kobject *, struct bin_attribute *, struct vm_area_struct *)' [- Wincompatible-pointer-types]
773 | res_attr->mmap = cdx_mmap_resource;
| ^

Quoted 7 lines
Fixes 94a20fb9af16 ("sysfs: treewide: constify attribute callback of

bin_attribute::mmap()")

---
 drivers/cdx/cdx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This change is already sent by Nathan here
https://lore.kernel.org/all/[email protected]/