From: Nathan Chancellor <nathan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Thomas Weißschuh" <linux@weissschuh.net>,
"Nipun Gupta" <nipun.gupta@amd.com>,
"Nikhil Agarwal" <nikhil.agarwal@amd.com>,
linux-kernel@vger.kernel.org, patches@lists.linux.dev,
"Nathan Chancellor" <nathan@kernel.org>
Subject: [PATCH] cdx: Fix cdx_mmap_resource() after constifying attr in ->mmap()
Date: Thu, 07 Nov 2024 10:07:43 -0700 [thread overview]
Message-ID: <20241107-sysfs-const-mmap-fix-cdx-v1-1-2ed9b7cd5f8b@kernel.org> (raw)
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@kernel.org>
---
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@kernel.org>
next reply other threads:[~2024-11-07 17:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 17:07 Nathan Chancellor [this message]
2024-11-08 14:45 ` [PATCH] cdx: Fix cdx_mmap_resource() after constifying attr in ->mmap() Thorsten Leemhuis
2024-11-08 17:23 ` Thomas Weißschuh
2024-11-08 17:54 ` Nathan Chancellor
2024-11-08 18:11 ` Thomas Weißschuh
2024-11-11 11:06 ` Agarwal, Nikhil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241107-sysfs-const-mmap-fix-cdx-v1-1-2ed9b7cd5f8b@kernel.org \
--to=nathan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=nikhil.agarwal@amd.com \
--cc=nipun.gupta@amd.com \
--cc=patches@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.