From 005cbe4462ac80f7277e35efa54b02f6741d17c3 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 20 Jan 2025 20:42:33 +0000 Subject: [PATCH] virt: hvc_sysfs: Another build fix for Linux v6.13 In Linux v6.13, commit 94a20fb9af16 ("sysfs: treewide: constify attribute callback of bin_attribute::mmap()") changed the type of the 'struct bin_attribute' argument of the bin_attribute:mmap function pointer to const. One instance of this change has already been fixed in the hvc_sysfs driver but another case was recently introduced breaking the build for Linux v6.13. Fix this in the same way as the previous instance. Bug 4985113 Bug 4991705 Change-Id: I7f68138f3b484ebfe7a4ff5032c7b4365865f248 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3287044 GVS: buildbot_gerritrpt Reviewed-by: Manish Bhardwaj --- drivers/virt/tegra/hvc_sysfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/virt/tegra/hvc_sysfs.c b/drivers/virt/tegra/hvc_sysfs.c index 87e945ee..b758b141 100644 --- a/drivers/virt/tegra/hvc_sysfs.c +++ b/drivers/virt/tegra/hvc_sysfs.c @@ -63,7 +63,12 @@ static struct hyp_shared_memory_info hyp_shared_memory_attrs[HYP_SHM_ID_NUM]; /* Map the HV trace buffer to the calling user process */ static int nvlog_buffer_mmap(struct file *fp, struct kobject *ko, - struct bin_attribute *attr, struct vm_area_struct *vma) +#if defined(NV_BIN_ATTRIBUTE_STRUCT_MMAP_HAS_CONST_BIN_ATTRIBUTE_ARG) /* Linux v6.13 */ + const struct bin_attribute *attr, +#else + struct bin_attribute *attr, +#endif + struct vm_area_struct *vma) { struct nvlog_shmem_info *info = container_of(attr, struct nvlog_shmem_info, attr);