summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-12-12 08:36:36 +0000
committerGuenter Roeck <linux@roeck-us.net>2018-12-16 15:13:47 -0800
commitf9facc24a6441d6a82d6cca942b162a394ecba66 (patch)
treefec95fd1dd345888bd05e91087b77fa95c005e31 /drivers/hwmon
parent626f5eaed15ab81e9ece29d3dc1cf9e5881110f3 (diff)
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: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/asus_atk0110.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
index a5638d1f7e4b..22be78cc5a4c 100644
--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -681,10 +681,8 @@ static int atk_debugfs_gitm_get(void *p, u64 *val)
return err;
}
-DEFINE_SIMPLE_ATTRIBUTE(atk_debugfs_gitm,
- atk_debugfs_gitm_get,
- NULL,
- "0x%08llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(atk_debugfs_gitm, atk_debugfs_gitm_get, NULL,
+ "0x%08llx\n");
static int atk_acpi_print(char *buf, size_t sz, union acpi_object *obj)
{
@@ -803,8 +801,8 @@ static void atk_debugfs_init(struct atk_data *data)
if (!f || IS_ERR(f))
goto cleanup;
- f = debugfs_create_file("gitm", 0400, d, data,
- &atk_debugfs_gitm);
+ f = debugfs_create_file_unsafe("gitm", 0400, d, data,
+ &atk_debugfs_gitm);
if (!f || IS_ERR(f))
goto cleanup;