Skip to content

Commit 0f85c48

Browse files
Qinglang MiaoKAGA-KOKO
authored andcommitted
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]
1 parent 11ba468 commit 0f85c48

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

lib/debugobjects.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,18 +1022,7 @@ static int debug_stats_show(struct seq_file *m, void *v)
10221022
seq_printf(m, "objs_freed :%d\n", debug_objects_freed);
10231023
return 0;
10241024
}
1025-
1026-
static int debug_stats_open(struct inode *inode, struct file *filp)
1027-
{
1028-
return single_open(filp, debug_stats_show, NULL);
1029-
}
1030-
1031-
static const struct file_operations debug_stats_fops = {
1032-
.open = debug_stats_open,
1033-
.read = seq_read,
1034-
.llseek = seq_lseek,
1035-
.release = single_release,
1036-
};
1025+
DEFINE_SHOW_ATTRIBUTE(debug_stats);
10371026

10381027
static int __init debug_objects_init_debugfs(void)
10391028
{

0 commit comments

Comments
 (0)