Commit f9dca154 authored by YueHaibing's avatar YueHaibing Committed by Kalle Valo

wil6210: fix debugfs_simple_attr.cocci warnings

Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
for debugfs files.

Semantic patch information:
Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
imposes some significant overhead as compared to
DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().

Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 72569b7b
...@@ -416,8 +416,8 @@ static int wil_debugfs_iomem_x32_get(void *data, u64 *val) ...@@ -416,8 +416,8 @@ static int wil_debugfs_iomem_x32_get(void *data, u64 *val)
return 0; return 0;
} }
DEFINE_SIMPLE_ATTRIBUTE(fops_iomem_x32, wil_debugfs_iomem_x32_get, DEFINE_DEBUGFS_ATTRIBUTE(fops_iomem_x32, wil_debugfs_iomem_x32_get,
wil_debugfs_iomem_x32_set, "0x%08llx\n"); wil_debugfs_iomem_x32_set, "0x%08llx\n");
static struct dentry *wil_debugfs_create_iomem_x32(const char *name, static struct dentry *wil_debugfs_create_iomem_x32(const char *name,
umode_t mode, umode_t mode,
...@@ -432,7 +432,8 @@ static struct dentry *wil_debugfs_create_iomem_x32(const char *name, ...@@ -432,7 +432,8 @@ static struct dentry *wil_debugfs_create_iomem_x32(const char *name,
data->wil = wil; data->wil = wil;
data->offset = value; data->offset = value;
file = debugfs_create_file(name, mode, parent, data, &fops_iomem_x32); file = debugfs_create_file_unsafe(name, mode, parent, data,
&fops_iomem_x32);
if (!IS_ERR_OR_NULL(file)) if (!IS_ERR_OR_NULL(file))
wil->dbg_data.iomem_data_count++; wil->dbg_data.iomem_data_count++;
...@@ -451,14 +452,15 @@ static int wil_debugfs_ulong_get(void *data, u64 *val) ...@@ -451,14 +452,15 @@ static int wil_debugfs_ulong_get(void *data, u64 *val)
return 0; return 0;
} }
DEFINE_SIMPLE_ATTRIBUTE(wil_fops_ulong, wil_debugfs_ulong_get, DEFINE_DEBUGFS_ATTRIBUTE(wil_fops_ulong, wil_debugfs_ulong_get,
wil_debugfs_ulong_set, "0x%llx\n"); wil_debugfs_ulong_set, "0x%llx\n");
static struct dentry *wil_debugfs_create_ulong(const char *name, umode_t mode, static struct dentry *wil_debugfs_create_ulong(const char *name, umode_t mode,
struct dentry *parent, struct dentry *parent,
ulong *value) ulong *value)
{ {
return debugfs_create_file(name, mode, parent, value, &wil_fops_ulong); return debugfs_create_file_unsafe(name, mode, parent, value,
&wil_fops_ulong);
} }
/** /**
......
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