Skip to contentSkip to conversation

sched/debug: use DEFINE_SHOW_ATTRIBUTE to simplify sd_flags

PATCH New Liu Shixin 1 participant 1 message Sep 22, 2022 Scheduler

lore
Share & tools
lore

Liu Shixin

author
#0 lore raw

PATCH 1/1 sched/debug: use DEFINE_SHOW_ATTRIBUTE to simplify sd_flags

Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. No functional change.

---
 kernel/sched/debug.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
kernel/sched/debug.c +1 -12
index 1637b65ba07a..45bc496c116e 100644
@@ -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)
 {
Signature · 1 line
2.25.1