Skip to content

Commit 5852357

Browse files
nathanchancegregkh
authored andcommitted
cdx: Fix cdx_mmap_resource() after constifying attr in ->mmap()
Commit 94a20fb ("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: 94a20fb ("sysfs: treewide: constify attribute callback of bin_attribute::mmap()") Signed-off-by: Nathan Chancellor <[email protected]> Tested-by: Thorsten Leemhuis <[email protected]> Reviewed-by: Thomas Weißschuu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 298c2af commit 5852357

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cdx/cdx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ static const struct vm_operations_struct cdx_phys_vm_ops = {
707707
* Return: true on success, false otherwise.
708708
*/
709709
static int cdx_mmap_resource(struct file *fp, struct kobject *kobj,
710-
struct bin_attribute *attr,
710+
const struct bin_attribute *attr,
711711
struct vm_area_struct *vma)
712712
{
713713
struct cdx_device *cdx_dev = to_cdx_device(kobj_to_dev(kobj));

0 commit comments

Comments
 (0)