From: YueHaibing <yuehaibing@huawei.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
David Hildenbrand <david@redhat.com>,
Michael Neuling <mikey@neuling.org>,
Balbir Singh <bsingharora@gmail.com>,
Rashmica Gupta <rashmica.g@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Pavel Tatashin <pavel.tatashin@microsoft.com>,
Stephen Rothwell <sfr@canb.auug.org.au>
Cc: YueHaibing <yuehaibing@huawei.com>,
<linuxppc-dev@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
<kernel-janitors@vger.kernel.org>
Subject: [PATCH -next] powerpc/powernv: Fix debugfs_simple_attr.cocci warnings
Date: Fri, 5 Oct 2018 10:50:31 +0000 [thread overview]
Message-ID: <1538736631-99728-1-git-send-email-yuehaibing@huawei.com> (raw)
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>
---
arch/powerpc/platforms/powernv/memtrace.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c
index 84d038e..0cb6548 100644
--- a/arch/powerpc/platforms/powernv/memtrace.c
+++ b/arch/powerpc/platforms/powernv/memtrace.c
@@ -311,8 +311,8 @@ static int memtrace_enable_get(void *data, u64 *val)
return 0;
}
-DEFINE_SIMPLE_ATTRIBUTE(memtrace_init_fops, memtrace_enable_get,
- memtrace_enable_set, "0x%016llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(memtrace_init_fops, memtrace_enable_get,
+ memtrace_enable_set, "0x%016llx\n");
static int memtrace_init(void)
{
@@ -321,8 +321,8 @@ static int memtrace_init(void)
if (!memtrace_debugfs_dir)
return -1;
- debugfs_create_file("enable", 0600, memtrace_debugfs_dir,
- NULL, &memtrace_init_fops);
+ debugfs_create_file_unsafe("enable", 0600, memtrace_debugfs_dir, NULL,
+ &memtrace_init_fops);
return 0;
}
next reply other threads:[~2018-10-05 10:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-05 10:50 YueHaibing [this message]
2018-10-08 8:27 ` [PATCH -next] powerpc/powernv: Fix debugfs_simple_attr.cocci warnings Michael Ellerman
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=1538736631-99728-1-git-send-email-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=bsingharora@gmail.com \
--cc=david@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=pavel.tatashin@microsoft.com \
--cc=rashmica.g@gmail.com \
--cc=sfr@canb.auug.org.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).