* [PATCH] sched/debug: use DEFINE_SHOW_ATTRIBUTE to simplify sd_flags
@ 2022-09-22 14:23 Liu Shixin
0 siblings, 0 replies; only message in thread
From: Liu Shixin @ 2022-09-22 14:23 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
Daniel Bristot de Oliveira, Valentin Schneider
Cc: linux-kernel, Liu Shixin
Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
No functional change.
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
kernel/sched/debug.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 1637b65ba07a..45bc496c116e 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -360,18 +360,7 @@ static int sd_flags_show(struct seq_file *m, void *v)
return 0;
}
-
-static int sd_flags_open(struct inode *inode, struct file *file)
-{
- return single_open(file, sd_flags_show, inode->i_private);
-}
-
-static const struct file_operations sd_flags_fops = {
- .open = sd_flags_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(sd_flags);
static void register_sd(struct sched_domain *sd, struct dentry *parent)
{
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-22 13:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 14:23 [PATCH] sched/debug: use DEFINE_SHOW_ATTRIBUTE to simplify sd_flags Liu Shixin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).