From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [PATCH] cpuidle: fix debugfs_simple_attr.cocci warnings
Date: Tue, 16 Mar 2021 06:44:54 +0800 [thread overview]
Message-ID: <20210315224454.GA33967@2bb5f4305114> (raw)
In-Reply-To: <20210315114827.46036-2-psampat@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 2878 bytes --]
From: kernel test robot <lkp@intel.com>
drivers/cpuidle/test-cpuidle_latency.c:95:0-23: WARNING: ipi_ops should be defined with DEFINE_DEBUGFS_ATTRIBUTE
drivers/cpuidle/test-cpuidle_latency.c:108:0-23: WARNING: timeout_ops should be defined with DEFINE_DEBUGFS_ATTRIBUTE
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
CC: Pratik Rajesh Sampat <psampat@linux.ibm.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
url: https://github.com/0day-ci/linux/commits/Pratik-Rajesh-Sampat/CPU-Idle-latency-selftest-framework/20210315-195036
base: https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git next
test-cpuidle_latency.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
--- a/drivers/cpuidle/test-cpuidle_latency.c
+++ b/drivers/cpuidle/test-cpuidle_latency.c
@@ -92,7 +92,7 @@ static int cpu_write_op(void *data, u64
run_smp_call_function_test(value);
return 0;
}
-DEFINE_SIMPLE_ATTRIBUTE(ipi_ops, cpu_read_op, cpu_write_op, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(ipi_ops, cpu_read_op, cpu_write_op, "%llu\n");
static int timeout_read_op(void *data, u64 *timeout)
{
@@ -105,7 +105,8 @@ static int timeout_write_op(void *data,
run_timer_test(value);
return 0;
}
-DEFINE_SIMPLE_ATTRIBUTE(timeout_ops, timeout_read_op, timeout_write_op, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(timeout_ops, timeout_read_op, timeout_write_op,
+ "%llu\n");
static int __init latency_init(void)
{
@@ -116,11 +117,8 @@ static int __init latency_init(void)
pr_alert("latency_test: failed to create /sys/kernel/debug/latency_test\n");
return -1;
}
- temp = debugfs_create_file("ipi_cpu_dest",
- 0666,
- dir,
- NULL,
- &ipi_ops);
+ temp = debugfs_create_file_unsafe("ipi_cpu_dest", 0666, dir, NULL,
+ &ipi_ops);
if (!temp) {
pr_alert("latency_test: failed to create /sys/kernel/debug/ipi_cpu_dest\n");
return -1;
@@ -128,11 +126,8 @@ static int __init latency_init(void)
debugfs_create_u64("ipi_latency_ns", 0444, dir, &ipi_wakeup.latency_ns);
debugfs_create_u32("ipi_cpu_src", 0444, dir, &ipi_wakeup.src_cpu);
- temp = debugfs_create_file("timeout_expected_ns",
- 0666,
- dir,
- NULL,
- &timeout_ops);
+ temp = debugfs_create_file_unsafe("timeout_expected_ns", 0666, dir,
+ NULL, &timeout_ops);
if (!temp) {
pr_alert("latency_test: failed to create /sys/kernel/debug/timeout_expected_ns\n");
return -1;
next prev parent reply other threads:[~2021-03-15 22:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 11:48 [RFC 0/2] CPU-Idle latency selftest framework Pratik Rajesh Sampat
2021-03-15 11:48 ` [RFC 1/2] cpuidle: Extract IPI based and timer based wakeup latency from idle states Pratik Rajesh Sampat
2021-03-15 15:30 ` kernel test robot
2021-03-15 22:44 ` kernel test robot
2021-03-15 22:44 ` kernel test robot [this message]
2021-03-15 11:48 ` [RFC 2/2] selftest/cpuidle: Add support for cpuidle latency measurement Pratik Rajesh Sampat
2021-03-17 21:00 ` Doug Smythies
2021-03-18 6:44 ` Pratik Sampat
2021-03-20 15:04 ` Doug Smythies
2021-03-22 12:56 ` Pratik Sampat
2021-04-02 9:03 [RFC v2 1/2] cpuidle: Extract IPI based and timer based wakeup latency from idle states kernel test robot
2021-04-02 9:03 ` [PATCH] cpuidle: fix debugfs_simple_attr.cocci warnings kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210315224454.GA33967@2bb5f4305114 \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.