[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f005d74e-7b35-42de-a80f-e5650e3d164d@weissschuh.net>
Date: Fri, 8 Nov 2024 12:23:50 -0500 (EST)
From: Thomas Weißschuh <thomas@...ssschuh.net>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Weißschuh <linux@...ssschuh.net>,
Nipun Gupta <nipun.gupta@....com>,
Nikhil Agarwal <nikhil.agarwal@....com>,
linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH] cdx: Fix cdx_mmap_resource() after constifying attr in
->mmap()
Hi Nathan,
Nov 7, 2024 12:07:56 Nathan Chancellor <nathan@...nel.org>:
> 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()")
I'm not sure about the Fixes tag.
cdx.c is not yet in mainline and this change should be folded into the cdx patch or the sysfs patch, depending on their order in the merge window.
I guess Greg will take care of it.
Thanks for the notification, though!
> Signed-off-by: Nathan Chancellor <nathan@...nel.org>
If it ends up as a real commit:
Reviewed-by: Thomas Weißschuu <linux@...ssschuh.net>
> ---
> drivers/cdx/cdx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c
> index 07371cb653d356977cbd3dd99a1b848146d5a993..316bd89a95caf97163a126478985c52b1b596bb4 100644
> --- a/drivers/cdx/cdx.c
> +++ b/drivers/cdx/cdx.c
> @@ -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));
>
> ---
> base-commit: 298c2af4788ed027a42c2bab0f210219825fb5fd
> change-id: 20241107-sysfs-const-mmap-fix-cdx-1457914fe16d
>
> Best regards,
> --
> Nathan Chancellor <nathan@...nel.org>
Powered by blists - more mailing lists