Commit 83c3fee7 authored by Daniel Axtens's avatar Daniel Axtens Committed by Michael Ellerman

cxl: sparse: Silence iomem warning in debugfs file creation

An IO address, tagged with __iomem, is passed to debugfs_create_file
as private data. This requires that it be cast to void *. The cast
drops the __iomem annotation and so creates a sparse warning:

  drivers/misc/cxl/debugfs.c:51:57: warning: cast removes address space of expression

The address space marker is added back in the file operations
(fops_io_u64).

Silence the warning with __force.
Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
Acked-by: default avatarMichael Neuling <mikey@neuling.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 3d6b040e
...@@ -48,7 +48,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_io_x64, debugfs_io_u64_get, debugfs_io_u64_set, "0x ...@@ -48,7 +48,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_io_x64, debugfs_io_u64_get, debugfs_io_u64_set, "0x
static struct dentry *debugfs_create_io_x64(const char *name, umode_t mode, static struct dentry *debugfs_create_io_x64(const char *name, umode_t mode,
struct dentry *parent, u64 __iomem *value) struct dentry *parent, u64 __iomem *value)
{ {
return debugfs_create_file(name, mode, parent, (void *)value, &fops_io_x64); return debugfs_create_file(name, mode, parent, (void __force *)value, &fops_io_x64);
} }
int cxl_debugfs_adapter_add(struct cxl *adapter) int cxl_debugfs_adapter_add(struct cxl *adapter)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment