diff options
author | Qinglang Miao <miaoqinglang@huawei.com> | 2020-07-16 10:47:47 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2020-07-17 23:25:46 +0200 |
commit | 0f85c4805184765ff35e0079b3241ee8f25d1b2b (patch) | |
tree | 3101fac003b2b9c6c0179c4c559d97585db2ae04 /lib/debugobjects.c | |
parent | Linux 5.8-rc5 (diff) | |
download | linux-0f85c4805184765ff35e0079b3241ee8f25d1b2b.tar.xz linux-0f85c4805184765ff35e0079b3241ee8f25d1b2b.zip |
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 <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
Diffstat (limited to 'lib/debugobjects.c')
-rw-r--r-- | lib/debugobjects.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 48054dbf1b51..fe4557955d97 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) { |