From: Qinglang Miao <miaoqinglang@huawei.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Marco Elver <elver@google.com>, Qian Cai <cai@lca.pw>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH -next] debugobjects: Convert to DEFINE_SHOW_ATTRIBUTE
Date: Thu, 16 Jul 2020 16:47:47 +0800 [thread overview]
Message-ID: <20200716084747.8034-1-miaoqinglang@huawei.com> (raw)
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
lib/debugobjects.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 5d2bbfc55..916a5c492 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -1023,17 +1023,7 @@ static int debug_stats_show(struct seq_file *m, void *v)
return 0;
}
-static int debug_stats_open(struct inode *inode, struct file *filp)
-{
- return single_open(filp, debug_stats_show, NULL);
-}
-
-static const struct file_operations debug_stats_fops = {
- .open = debug_stats_open,
- .read_iter = seq_read_iter,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(debug_stats);
static int __init debug_objects_init_debugfs(void)
{
--
2.17.1
next reply other threads:[~2020-07-16 8:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 8:47 Qinglang Miao [this message]
2020-07-17 20:26 ` Thomas Gleixner
2020-07-20 2:18 ` miaoqinglang
2020-07-17 21:29 ` [tip: core/debugobjects] " tip-bot2 for Qinglang Miao
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=20200716084747.8034-1-miaoqinglang@huawei.com \
--to=miaoqinglang@huawei.com \
--cc=cai@lca.pw \
--cc=elver@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®