Skip to contentSkip to conversation

gpu: host1x: Convert to DEFINE_SHOW_ATTRIBUTE

PATCH Superseded Qinglang Miao 2 participants 5 messages Jul 16, 2020 – Sep 17, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpu: host1x: Convert to DEFINE_SHOW_ATTRIBUTE

From: Yongqiang Liu <[email protected]>

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

---
 drivers/gpu/host1x/debug.c | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)
drivers/gpu/host1x/debug.c +4 -24
index 545fc0afb..1688e98c4 100644
@@ -110,7 +110,7 @@ static void show_all(struct host1x *m, struct output *o, bool show_fifo)
 	}
 }
 
-static int host1x_debug_show_all(struct seq_file *s, void *unused)
+static int host1x_debug_all_show(struct seq_file *s, void *unused)
 {
 	struct output o = {
 		.fn = write_to_seqfile,
@@ -122,6 +122,8 @@ static int host1x_debug_show_all(struct seq_file *s, void *unused)
 	return 0;
 }
 
+DEFINE_SHOW_ATTRIBUTE(host1x_debug_all);
+
 static int host1x_debug_show(struct seq_file *s, void *unused)
 {
 	struct output o = {
@@ -134,29 +136,7 @@ static int host1x_debug_show(struct seq_file *s, void *unused)
 	return 0;
 }
 
-static int host1x_debug_open_all(struct inode *inode, struct file *file)
-{
-	return single_open(file, host1x_debug_show_all, inode->i_private);
-}
-
-static const struct file_operations host1x_debug_all_fops = {
-	.open = host1x_debug_open_all,
-	.read_iter = seq_read_iter,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
-
-static int host1x_debug_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, host1x_debug_show, inode->i_private);
-}
-
-static const struct file_operations host1x_debug_fops = {
-	.open = host1x_debug_open,
-	.read_iter = seq_read_iter,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(host1x_debug);
 
 static void host1x_debugfs_init(struct host1x *host1x)
 {
Signature · 1 line
2.17.1
#1 lore raw
Quoted 8 lines · Qinglang Miao

From: Yongqiang Liu <[email protected]>

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

---
 drivers/gpu/host1x/debug.c | 28 ++++------------------------
 1 file changed, 4 insertions(+), 24 deletions(-)

This doesn't apply. Can you please resend, based on something like linux-next?

Thanks,
Thierry

#2 lore raw
Quoted 9 lines · Thierry Reding
Quoted 8 lines · Qinglang Miao

From: Yongqiang Liu <[email protected]>

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

---
  drivers/gpu/host1x/debug.c | 28 ++++------------------------
  1 file changed, 4 insertions(+), 24 deletions(-)
Quoted 5 lines

This doesn't apply. Can you please resend, based on something like linux-next?

Thanks,
Thierry

Hi, Thierry

  Sorry I didn't mention it in commit log, but this patch is based on linux-next where commit <4d4901c6d7> has switched over direct  seq_read method calls to seq_read_iter, this is why there's conflict in  your apply.

  Do you think I should send a new patch based on 5.8rc?

Thanks.

#3 lore raw
Quoted 16 lines · miaoqinglang
Quoted 9 lines · Thierry Reding
Quoted 8 lines · Qinglang Miao

From: Yongqiang Liu <[email protected]>

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

---
  drivers/gpu/host1x/debug.c | 28 ++++------------------------
  1 file changed, 4 insertions(+), 24 deletions(-)
Quoted 5 lines

This doesn't apply. Can you please resend, based on something like linux-next?

Thanks,
Thierry

Quoted 7 lines

Hi, Thierry

  Sorry I didn't mention it in commit log, but this patch is based on linux-next where commit <4d4901c6d7> has switched over direct  seq_read method calls to seq_read_iter, this is why there's conflict in  your apply.

  Do you think I should send a new patch based on 5.8rc?

No need to. I'm about to send out the pull request for v5.9-rc1, so I'll just defer this to v5.10 since it doesn't look like it's anything urgent.

Thierry

#4 lore raw
Quoted 23 lines · Thierry Reding
Quoted 22 lines · miaoqinglang
Quoted 9 lines · Thierry Reding
Quoted 8 lines · Qinglang Miao

From: Yongqiang Liu <[email protected]>

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

---
   drivers/gpu/host1x/debug.c | 28 ++++------------------------
   1 file changed, 4 insertions(+), 24 deletions(-)
Quoted 5 lines

This doesn't apply. Can you please resend, based on something like linux-next?

Thanks,
Thierry

Hi, Thierry

  Sorry I didn't mention it in commit log, but this patch is based on
linux-next where commit <4d4901c6d7> has switched over direct  seq_read method calls to seq_read_iter, this is why there's conflict in  your apply.

Quoted 8 lines
Quoted 1 line

  Do you think I should send a new patch based on 5.8rc?

No need to. I'm about to send out the pull request for v5.9-rc1, so I'll just defer this to v5.10 since it doesn't look like it's anything urgent.

Thierry

Hi, Thierry

I've sent a new patch against linux-next(20200917), and can be applied to mainline cleanly now. So I suggest you v2 patch.

Thanks.