Commit f9facc24 authored by YueHaibing's avatar YueHaibing Committed by Guenter Roeck

hwmon: (asus_atk0110) 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 avatarGuenter Roeck <linux@roeck-us.net>
parent 626f5eae
...@@ -681,9 +681,7 @@ static int atk_debugfs_gitm_get(void *p, u64 *val) ...@@ -681,9 +681,7 @@ static int atk_debugfs_gitm_get(void *p, u64 *val)
return err; return err;
} }
DEFINE_SIMPLE_ATTRIBUTE(atk_debugfs_gitm, DEFINE_DEBUGFS_ATTRIBUTE(atk_debugfs_gitm, atk_debugfs_gitm_get, NULL,
atk_debugfs_gitm_get,
NULL,
"0x%08llx\n"); "0x%08llx\n");
static int atk_acpi_print(char *buf, size_t sz, union acpi_object *obj) static int atk_acpi_print(char *buf, size_t sz, union acpi_object *obj)
...@@ -803,7 +801,7 @@ static void atk_debugfs_init(struct atk_data *data) ...@@ -803,7 +801,7 @@ static void atk_debugfs_init(struct atk_data *data)
if (!f || IS_ERR(f)) if (!f || IS_ERR(f))
goto cleanup; goto cleanup;
f = debugfs_create_file("gitm", 0400, d, data, f = debugfs_create_file_unsafe("gitm", 0400, d, data,
&atk_debugfs_gitm); &atk_debugfs_gitm);
if (!f || IS_ERR(f)) if (!f || IS_ERR(f))
goto cleanup; goto cleanup;
......
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