Re: [PATCH] cdx: Fix cdx_mmap_resource() after constifying attr in ->mmap()
From: Thorsten Leemhuis
Date: Fri Nov 08 2024 - 09:46:01 EST
On 07.11.24 18:07, Nathan Chancellor wrote:
> Commit 94a20fb9af16 ("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: 94a20fb9af16 ("sysfs: treewide: constify attribute callback of bin_attribute::mmap()")
> Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
Ran into the described problem for my daily -next builds on all Fedora
releases on ARM64 yesterday and today. This fixes it for me.
Tested-by: Thorsten Leemhuis <linux@xxxxxxxxxxxxx>
Ciao, Thorsten