mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] debugobjects: Convert to DEFINE_SHOW_ATTRIBUTE
@ 2020-07-16  8:47 Qinglang Miao
  2020-07-17 20:26 ` Thomas Gleixner
  2020-07-17 21:29 ` [tip: core/debugobjects] " tip-bot2 for Qinglang Miao
  0 siblings, 2 replies; 4+ messages in thread
From: Qinglang Miao @ 2020-07-16  8:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Thomas Gleixner, Marco Elver, Qian Cai; +Cc: linux-kernel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-20  2:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16  8:47 [PATCH -next] debugobjects: Convert to DEFINE_SHOW_ATTRIBUTE Qinglang Miao
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

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®