* [PATCH] KVM: PPC: Remove superfluous check for non-zero return value
@ 2019-09-11 19:52 Thomas Huth
2019-09-18 16:44 ` [PATCH trivial] " Greg Kurz
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2019-09-11 19:52 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, linux-kernel, kvm-ppc
After the kfree()s haven been removed in the previous
commit 9798f4ea71ea ("fix rollback when kvmppc_xive_create fails"),
the code can be simplified even more to simply always "return ret"
now.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
arch/powerpc/kvm/book3s_xive.c | 5 +----
arch/powerpc/kvm/book3s_xive_native.c | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c
index e3ba67095895..2f6f463fcdfb 100644
--- a/arch/powerpc/kvm/book3s_xive.c
+++ b/arch/powerpc/kvm/book3s_xive.c
@@ -1986,10 +1986,7 @@ static int kvmppc_xive_create(struct kvm_device *dev, u32 type)
xive->single_escalation = xive_native_has_single_escalation();
- if (ret)
- return ret;
-
- return 0;
+ return ret;
}
int kvmppc_xive_debug_show_queues(struct seq_file *m, struct kvm_vcpu *vcpu)
diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
index a998823f68a3..7a50772f26fe 100644
--- a/arch/powerpc/kvm/book3s_xive_native.c
+++ b/arch/powerpc/kvm/book3s_xive_native.c
@@ -1089,10 +1089,7 @@ static int kvmppc_xive_native_create(struct kvm_device *dev, u32 type)
xive->single_escalation = xive_native_has_single_escalation();
xive->ops = &kvmppc_xive_native_ops;
- if (ret)
- return ret;
-
- return 0;
+ return ret;
}
/*
--
2.18.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH trivial] KVM: PPC: Remove superfluous check for non-zero return value
2019-09-11 19:52 [PATCH] KVM: PPC: Remove superfluous check for non-zero return value Thomas Huth
@ 2019-09-18 16:44 ` Greg Kurz
2019-09-18 20:54 ` Greg Kurz
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2019-09-18 16:44 UTC (permalink / raw)
To: Thomas Huth; +Cc: Jiri Kosina, linuxppc-dev, linux-kernel, kvm-ppc
On Wed, 11 Sep 2019 21:52:35 +0200
Thomas Huth <thuth@redhat.com> wrote:
> After the kfree()s haven been removed in the previous
> commit 9798f4ea71ea ("fix rollback when kvmppc_xive_create fails"),
> the code can be simplified even more to simply always "return ret"
> now.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
This looks like a good candidate for trivial, hence Cc'ing Jiri
and adding trivial keyword in subject.
Reviewed-by: Greg Kurz <groug@kaod.org>
> arch/powerpc/kvm/book3s_xive.c | 5 +----
> arch/powerpc/kvm/book3s_xive_native.c | 5 +----
> 2 files changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c
> index e3ba67095895..2f6f463fcdfb 100644
> --- a/arch/powerpc/kvm/book3s_xive.c
> +++ b/arch/powerpc/kvm/book3s_xive.c
> @@ -1986,10 +1986,7 @@ static int kvmppc_xive_create(struct kvm_device *dev, u32 type)
>
> xive->single_escalation = xive_native_has_single_escalation();
>
> - if (ret)
> - return ret;
> -
> - return 0;
> + return ret;
> }
>
> int kvmppc_xive_debug_show_queues(struct seq_file *m, struct kvm_vcpu *vcpu)
> diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
> index a998823f68a3..7a50772f26fe 100644
> --- a/arch/powerpc/kvm/book3s_xive_native.c
> +++ b/arch/powerpc/kvm/book3s_xive_native.c
> @@ -1089,10 +1089,7 @@ static int kvmppc_xive_native_create(struct kvm_device *dev, u32 type)
> xive->single_escalation = xive_native_has_single_escalation();
> xive->ops = &kvmppc_xive_native_ops;
>
> - if (ret)
> - return ret;
> -
> - return 0;
> + return ret;
> }
>
> /*
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH trivial] KVM: PPC: Remove superfluous check for non-zero return value
2019-09-18 16:44 ` [PATCH trivial] " Greg Kurz
@ 2019-09-18 20:54 ` Greg Kurz
2019-09-19 5:51 ` Thomas Huth
0 siblings, 1 reply; 4+ messages in thread
From: Greg Kurz @ 2019-09-18 20:54 UTC (permalink / raw)
To: Thomas Huth; +Cc: Jiri Kosina, linuxppc-dev, linux-kernel, kvm-ppc
On Wed, 18 Sep 2019 18:44:36 +0200
Greg Kurz <groug@kaod.org> wrote:
> On Wed, 11 Sep 2019 21:52:35 +0200
> Thomas Huth <thuth@redhat.com> wrote:
>
> > After the kfree()s haven been removed in the previous
> > commit 9798f4ea71ea ("fix rollback when kvmppc_xive_create fails"),
> > the code can be simplified even more to simply always "return ret"
> > now.
> >
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
>
> This looks like a good candidate for trivial, hence Cc'ing Jiri
> and adding trivial keyword in subject.
>
> Reviewed-by: Greg Kurz <groug@kaod.org>
>
Oops, the patch is correct but there are some fixes that require
the return 0 to stay around...
https://patchwork.ozlabs.org/project/kvm-ppc/list/?series=129957
> > arch/powerpc/kvm/book3s_xive.c | 5 +----
> > arch/powerpc/kvm/book3s_xive_native.c | 5 +----
> > 2 files changed, 2 insertions(+), 8 deletions(-)
> >
> > diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c
> > index e3ba67095895..2f6f463fcdfb 100644
> > --- a/arch/powerpc/kvm/book3s_xive.c
> > +++ b/arch/powerpc/kvm/book3s_xive.c
> > @@ -1986,10 +1986,7 @@ static int kvmppc_xive_create(struct kvm_device *dev, u32 type)
> >
> > xive->single_escalation = xive_native_has_single_escalation();
> >
> > - if (ret)
> > - return ret;
> > -
> > - return 0;
> > + return ret;
> > }
> >
> > int kvmppc_xive_debug_show_queues(struct seq_file *m, struct kvm_vcpu *vcpu)
> > diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
> > index a998823f68a3..7a50772f26fe 100644
> > --- a/arch/powerpc/kvm/book3s_xive_native.c
> > +++ b/arch/powerpc/kvm/book3s_xive_native.c
> > @@ -1089,10 +1089,7 @@ static int kvmppc_xive_native_create(struct kvm_device *dev, u32 type)
> > xive->single_escalation = xive_native_has_single_escalation();
> > xive->ops = &kvmppc_xive_native_ops;
> >
> > - if (ret)
> > - return ret;
> > -
> > - return 0;
> > + return ret;
> > }
> >
> > /*
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH trivial] KVM: PPC: Remove superfluous check for non-zero return value
2019-09-18 20:54 ` Greg Kurz
@ 2019-09-19 5:51 ` Thomas Huth
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2019-09-19 5:51 UTC (permalink / raw)
To: Greg Kurz; +Cc: Jiri Kosina, linuxppc-dev, linux-kernel, kvm-ppc
On 18/09/2019 22.54, Greg Kurz wrote:
> On Wed, 18 Sep 2019 18:44:36 +0200
> Greg Kurz <groug@kaod.org> wrote:
>
>> On Wed, 11 Sep 2019 21:52:35 +0200
>> Thomas Huth <thuth@redhat.com> wrote:
>>
>>> After the kfree()s haven been removed in the previous
>>> commit 9798f4ea71ea ("fix rollback when kvmppc_xive_create fails"),
>>> the code can be simplified even more to simply always "return ret"
>>> now.
>>>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>
>> This looks like a good candidate for trivial, hence Cc'ing Jiri
>> and adding trivial keyword in subject.
>>
>> Reviewed-by: Greg Kurz <groug@kaod.org>
>>
>
> Oops, the patch is correct but there are some fixes that require
> the return 0 to stay around...
>
> https://patchwork.ozlabs.org/project/kvm-ppc/list/?series=129957
:-)
Ok, then please simply ignore my patch.
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-09-19 5:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 19:52 [PATCH] KVM: PPC: Remove superfluous check for non-zero return value Thomas Huth
2019-09-18 16:44 ` [PATCH trivial] " Greg Kurz
2019-09-18 20:54 ` Greg Kurz
2019-09-19 5:51 ` Thomas Huth
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).