Skip to content

Commit 8c6c942

Browse files
YueHaibingmpe
authored andcommitted
powerpc/eeh: 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> Acked-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent e59f5bd commit 8c6c942

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

arch/powerpc/kernel/eeh.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,23 +1808,23 @@ static int eeh_freeze_dbgfs_get(void *data, u64 *val)
18081808
return 0;
18091809
}
18101810

1811-
DEFINE_SIMPLE_ATTRIBUTE(eeh_enable_dbgfs_ops, eeh_enable_dbgfs_get,
1812-
eeh_enable_dbgfs_set, "0x%llx\n");
1813-
DEFINE_SIMPLE_ATTRIBUTE(eeh_freeze_dbgfs_ops, eeh_freeze_dbgfs_get,
1814-
eeh_freeze_dbgfs_set, "0x%llx\n");
1811+
DEFINE_DEBUGFS_ATTRIBUTE(eeh_enable_dbgfs_ops, eeh_enable_dbgfs_get,
1812+
eeh_enable_dbgfs_set, "0x%llx\n");
1813+
DEFINE_DEBUGFS_ATTRIBUTE(eeh_freeze_dbgfs_ops, eeh_freeze_dbgfs_get,
1814+
eeh_freeze_dbgfs_set, "0x%llx\n");
18151815
#endif
18161816

18171817
static int __init eeh_init_proc(void)
18181818
{
18191819
if (machine_is(pseries) || machine_is(powernv)) {
18201820
proc_create_single("powerpc/eeh", 0, NULL, proc_eeh_show);
18211821
#ifdef CONFIG_DEBUG_FS
1822-
debugfs_create_file("eeh_enable", 0600,
1823-
powerpc_debugfs_root, NULL,
1824-
&eeh_enable_dbgfs_ops);
1825-
debugfs_create_file("eeh_max_freezes", 0600,
1826-
powerpc_debugfs_root, NULL,
1827-
&eeh_freeze_dbgfs_ops);
1822+
debugfs_create_file_unsafe("eeh_enable", 0600,
1823+
powerpc_debugfs_root, NULL,
1824+
&eeh_enable_dbgfs_ops);
1825+
debugfs_create_file_unsafe("eeh_max_freezes", 0600,
1826+
powerpc_debugfs_root, NULL,
1827+
&eeh_freeze_dbgfs_ops);
18281828
#endif
18291829
}
18301830

0 commit comments

Comments
 (0)