Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c6c942d authored by YueHaibing's avatar YueHaibing Committed by Michael Ellerman
Browse files

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: default avatarYueHaibing <yuehaibing@huawei.com>
Acked-by: default avatarRussell Currey <ruscur@russell.cc>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent e59f5bd7
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -1808,9 +1808,9 @@ static int eeh_freeze_dbgfs_get(void *data, u64 *val)
	return 0;
}

DEFINE_SIMPLE_ATTRIBUTE(eeh_enable_dbgfs_ops, eeh_enable_dbgfs_get,
DEFINE_DEBUGFS_ATTRIBUTE(eeh_enable_dbgfs_ops, eeh_enable_dbgfs_get,
			 eeh_enable_dbgfs_set, "0x%llx\n");
DEFINE_SIMPLE_ATTRIBUTE(eeh_freeze_dbgfs_ops, eeh_freeze_dbgfs_get,
DEFINE_DEBUGFS_ATTRIBUTE(eeh_freeze_dbgfs_ops, eeh_freeze_dbgfs_get,
			 eeh_freeze_dbgfs_set, "0x%llx\n");
#endif

@@ -1819,10 +1819,10 @@ static int __init eeh_init_proc(void)
	if (machine_is(pseries) || machine_is(powernv)) {
		proc_create_single("powerpc/eeh", 0, NULL, proc_eeh_show);
#ifdef CONFIG_DEBUG_FS
		debugfs_create_file("eeh_enable", 0600,
		debugfs_create_file_unsafe("eeh_enable", 0600,
					   powerpc_debugfs_root, NULL,
					   &eeh_enable_dbgfs_ops);
		debugfs_create_file("eeh_max_freezes", 0600,
		debugfs_create_file_unsafe("eeh_max_freezes", 0600,
					   powerpc_debugfs_root, NULL,
					   &eeh_freeze_dbgfs_ops);
#endif