aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-12-28 02:24:13 -0500
committerIngo Molnar <mingo@kernel.org>2019-04-19 13:25:08 -0400
commit28156d7678431312b463361b23a218a1b5645ba5 (patch)
treea4608bfd19323e8a968383d74649daf9355831a0
parent39f0584ee695f1d75f4181b209602b9c49e73821 (diff)
x86/mce: 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> Cc: Borislav Petkov <bp@alien8.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: Vishal Verma <vishal.l.verma@intel.com> Cc: Yazen Ghannam <yazen.ghannam@amd.com> Cc: kernel-janitors@vger.kernel.org Link: http://lkml.kernel.org/r/1545981853-70877-1-git-send-email-yuehaibing@huawei.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/cpu/mce/core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 58925e7ccb27..3e081428117c 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -2429,8 +2429,8 @@ static int fake_panic_set(void *data, u64 val)
2429 return 0; 2429 return 0;
2430} 2430}
2431 2431
2432DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get, 2432DEFINE_DEBUGFS_ATTRIBUTE(fake_panic_fops, fake_panic_get, fake_panic_set,
2433 fake_panic_set, "%llu\n"); 2433 "%llu\n");
2434 2434
2435static int __init mcheck_debugfs_init(void) 2435static int __init mcheck_debugfs_init(void)
2436{ 2436{
@@ -2439,8 +2439,8 @@ static int __init mcheck_debugfs_init(void)
2439 dmce = mce_get_debugfs_dir(); 2439 dmce = mce_get_debugfs_dir();
2440 if (!dmce) 2440 if (!dmce)
2441 return -ENOMEM; 2441 return -ENOMEM;
2442 ffake_panic = debugfs_create_file("fake_panic", 0444, dmce, NULL, 2442 ffake_panic = debugfs_create_file_unsafe("fake_panic", 0444, dmce,
2443 &fake_panic_fops); 2443 NULL, &fake_panic_fops);
2444 if (!ffake_panic) 2444 if (!ffake_panic)
2445 return -ENOMEM; 2445 return -ENOMEM;
2446 2446