The following commit has been merged into the core/debugobjects branch of tip:

Commit-ID:     0f85c4805184765ff35e0079b3241ee8f25d1b2b
Gitweb:        
https://git.kernel.org/tip/0f85c4805184765ff35e0079b3241ee8f25d1b2b
Author:        Qinglang Miao <[email protected]>
AuthorDate:    Thu, 16 Jul 2020 16:47:47 +08:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Fri, 17 Jul 2020 23:25:46 +02:00

debugobjects: Convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

[ tglx: Distangled it from the mess in -next ]

Signed-off-by: Qinglang Miao <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]

---
 lib/debugobjects.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 48054db..fe45579 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -1022,18 +1022,7 @@ static int debug_stats_show(struct seq_file *m, void *v)
        seq_printf(m, "objs_freed    :%d\n", debug_objects_freed);
        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           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(debug_stats);
 
 static int __init debug_objects_init_debugfs(void)
 {

Reply via email to