projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11ba468
)
debugobjects: Convert to DEFINE_SHOW_ATTRIBUTE
author
Qinglang Miao
<miaoqinglang@huawei.com>
Thu, 16 Jul 2020 08:47:47 +0000
(16:47 +0800)
committer
Thomas Gleixner
<tglx@linutronix.de>
Fri, 17 Jul 2020 21:25:46 +0000
(23:25 +0200)
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
[ tglx: Distangled it from the mess in -next ]
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: hch@lst.de
Link:
https://lkml.kernel.org/r/20200716084747.8034-1-miaoqinglang@huawei.com
lib/debugobjects.c
patch
|
blob
|
history
diff --git
a/lib/debugobjects.c
b/lib/debugobjects.c
index 48054dbf1b51fbd1bb6486bcb8b5de1786bc2304..fe4557955d976f45bcb85980ba469a7d91352b75 100644
(file)
--- 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)
{