powerpc/mm: Fix debugfs_simple_attr.cocci warnings
authorYueHaibing <yuehaibing@huawei.com>
Wed, 9 Jan 2019 12:10:58 +0000 (12:10 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 14 Jan 2019 09:39:27 +0000 (20:39 +1100)
Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
for debugfs files.

Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/hash_utils_64.c

index 0cc7fbc..4aa0797 100644 (file)
@@ -1889,12 +1889,12 @@ static int hpt_order_set(void *data, u64 val)
        return mmu_hash_ops.resize_hpt(val);
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(fops_hpt_order, hpt_order_get, hpt_order_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(fops_hpt_order, hpt_order_get, hpt_order_set, "%llu\n");
 
 static int __init hash64_debugfs(void)
 {
-       if (!debugfs_create_file("hpt_order", 0600, powerpc_debugfs_root,
-                                NULL, &fops_hpt_order)) {
+       if (!debugfs_create_file_unsafe("hpt_order", 0600, powerpc_debugfs_root,
+                                       NULL, &fops_hpt_order)) {
                pr_err("lpar: unable to create hpt_order debugsfs file\n");
        }