All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] KVM: arm64: vgic-debug: convert to use DEFINE_SEQ_ATTRIBUTE macro
@ 2020-09-16  2:50 ` Liu Shixin
  0 siblings, 0 replies; 5+ messages in thread
From: Liu Shixin @ 2020-09-16  2:50 UTC (permalink / raw)
  To: Marc Zyngier, James Morse, Julien Thierry, Suzuki K Poulose,
	Catalin Marinas, Will Deacon
  Cc: kvmarm, linux-kernel, Liu Shixin

Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 arch/arm64/kvm/vgic/vgic-debug.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c
index b13a9e3f99dd..f38c40a76251 100644
--- a/arch/arm64/kvm/vgic/vgic-debug.c
+++ b/arch/arm64/kvm/vgic/vgic-debug.c
@@ -260,34 +260,14 @@ static int vgic_debug_show(struct seq_file *s, void *v)
 	return 0;
 }
 
-static const struct seq_operations vgic_debug_seq_ops = {
+static const struct seq_operations vgic_debug_sops = {
 	.start = vgic_debug_start,
 	.next  = vgic_debug_next,
 	.stop  = vgic_debug_stop,
 	.show  = vgic_debug_show
 };
 
-static int debug_open(struct inode *inode, struct file *file)
-{
-	int ret;
-	ret = seq_open(file, &vgic_debug_seq_ops);
-	if (!ret) {
-		struct seq_file *seq;
-		/* seq_open will have modified file->private_data */
-		seq = file->private_data;
-		seq->private = inode->i_private;
-	}
-
-	return ret;
-};
-
-static const struct file_operations vgic_debug_fops = {
-	.owner   = THIS_MODULE,
-	.open    = debug_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
-	.release = seq_release
-};
+DEFINE_SEQ_ATTRIBUTE(vgic_debug);
 
 void vgic_debug_init(struct kvm *kvm)
 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH -next] KVM: arm64: vgic-debug: convert to use DEFINE_SEQ_ATTRIBUTE macro
@ 2020-09-16  2:50 ` Liu Shixin
  0 siblings, 0 replies; 5+ messages in thread
From: Liu Shixin @ 2020-09-16  2:50 UTC (permalink / raw)
  To: Marc Zyngier, James Morse, Julien Thierry, Suzuki K Poulose,
	Catalin Marinas, Will Deacon
  Cc: Liu Shixin, kvmarm, linux-kernel

Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 arch/arm64/kvm/vgic/vgic-debug.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c
index b13a9e3f99dd..f38c40a76251 100644
--- a/arch/arm64/kvm/vgic/vgic-debug.c
+++ b/arch/arm64/kvm/vgic/vgic-debug.c
@@ -260,34 +260,14 @@ static int vgic_debug_show(struct seq_file *s, void *v)
 	return 0;
 }
 
-static const struct seq_operations vgic_debug_seq_ops = {
+static const struct seq_operations vgic_debug_sops = {
 	.start = vgic_debug_start,
 	.next  = vgic_debug_next,
 	.stop  = vgic_debug_stop,
 	.show  = vgic_debug_show
 };
 
-static int debug_open(struct inode *inode, struct file *file)
-{
-	int ret;
-	ret = seq_open(file, &vgic_debug_seq_ops);
-	if (!ret) {
-		struct seq_file *seq;
-		/* seq_open will have modified file->private_data */
-		seq = file->private_data;
-		seq->private = inode->i_private;
-	}
-
-	return ret;
-};
-
-static const struct file_operations vgic_debug_fops = {
-	.owner   = THIS_MODULE,
-	.open    = debug_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
-	.release = seq_release
-};
+DEFINE_SEQ_ATTRIBUTE(vgic_debug);
 
 void vgic_debug_init(struct kvm *kvm)
 {
-- 
2.25.1

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] KVM: arm64: vgic-debug: convert to use DEFINE_SEQ_ATTRIBUTE macro
  2020-09-16  2:50 ` Liu Shixin
  (?)
@ 2020-09-18 15:56   ` Marc Zyngier
  -1 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2020-09-18 15:56 UTC (permalink / raw)
  To: linux-arm-kernel, Alexandru Elisei, kvmarm, Catalin Marinas,
	James Morse, Suzuki K Poulose, Julien Thierry, Will Deacon,
	Liu Shixin
  Cc: linux-kernel

On Wed, 16 Sep 2020 10:50:23 +0800, Liu Shixin wrote:
> Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Applied to next, thanks!

[1/1] KVM: arm64: vgic-debug: Convert to use DEFINE_SEQ_ATTRIBUTE macro
      commit: cb62e0b5c8db778cd29e63c2f844f36caf6859ed

Cheers,

	M.
-- 
Without deviation from the norm, progress is not possible.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] KVM: arm64: vgic-debug: convert to use DEFINE_SEQ_ATTRIBUTE macro
@ 2020-09-18 15:56   ` Marc Zyngier
  0 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2020-09-18 15:56 UTC (permalink / raw)
  To: linux-arm-kernel, Alexandru Elisei, kvmarm, Catalin Marinas,
	James Morse, Suzuki K Poulose, Julien Thierry, Will Deacon,
	Liu Shixin
  Cc: linux-kernel

On Wed, 16 Sep 2020 10:50:23 +0800, Liu Shixin wrote:
> Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Applied to next, thanks!

[1/1] KVM: arm64: vgic-debug: Convert to use DEFINE_SEQ_ATTRIBUTE macro
      commit: cb62e0b5c8db778cd29e63c2f844f36caf6859ed

Cheers,

	M.
-- 
Without deviation from the norm, progress is not possible.


_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] KVM: arm64: vgic-debug: convert to use DEFINE_SEQ_ATTRIBUTE macro
@ 2020-09-18 15:56   ` Marc Zyngier
  0 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2020-09-18 15:56 UTC (permalink / raw)
  To: linux-arm-kernel, Alexandru Elisei, kvmarm, Catalin Marinas,
	James Morse, Suzuki K Poulose, Julien Thierry, Will Deacon,
	Liu Shixin
  Cc: linux-kernel

On Wed, 16 Sep 2020 10:50:23 +0800, Liu Shixin wrote:
> Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Applied to next, thanks!

[1/1] KVM: arm64: vgic-debug: Convert to use DEFINE_SEQ_ATTRIBUTE macro
      commit: cb62e0b5c8db778cd29e63c2f844f36caf6859ed

Cheers,

	M.
-- 
Without deviation from the norm, progress is not possible.



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-18 15:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16  2:50 [PATCH -next] KVM: arm64: vgic-debug: convert to use DEFINE_SEQ_ATTRIBUTE macro Liu Shixin
2020-09-16  2:50 ` Liu Shixin
2020-09-18 15:56 ` Marc Zyngier
2020-09-18 15:56   ` Marc Zyngier
2020-09-18 15:56   ` Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.