Commit 5852357d authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Greg Kroah-Hartman
Browse files

cdx: Fix cdx_mmap_resource() after constifying attr in ->mmap()



Commit 94a20fb9 ("sysfs: treewide: constify attribute callback of
bin_attribute::mmap()") missed updating the attr parameter of
cdx_mmap_resource(), resulting in a build failure.

  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;
        |                        ^

Update cdx_mmap_resource() to match, resolving the build failure.

Fixes: 94a20fb9 ("sysfs: treewide: constify attribute callback of bin_attribute::mmap()")
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Tested-by: default avatarThorsten Leemhuis <linux@leemhuis.info>
Reviewed-by: default avatarThomas Weißschuu <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241107-sysfs-const-mmap-fix-cdx-v1-1-2ed9b7cd5f8b@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 298c2af4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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));