LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] KVM: MMIO: get rid of odd out_err label in kvm_coalesced_mmio_init
@ 2019-11-09  8:08 linmiaohe
  2019-11-11 14:07 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: linmiaohe @ 2019-11-09  8:08 UTC (permalink / raw)
  To: pbonzini, rkrcmar; +Cc: linmiaohe, kvm, linux-kernel

From: Miaohe Lin <linmiaohe@huawei.com>

The out_err label and var ret is unnecessary, clean them up.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 virt/kvm/coalesced_mmio.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/virt/kvm/coalesced_mmio.c b/virt/kvm/coalesced_mmio.c
index 8ffd07e2a160..00c747dbc82e 100644
--- a/virt/kvm/coalesced_mmio.c
+++ b/virt/kvm/coalesced_mmio.c
@@ -110,14 +110,11 @@ static const struct kvm_io_device_ops coalesced_mmio_ops = {
 int kvm_coalesced_mmio_init(struct kvm *kvm)
 {
 	struct page *page;
-	int ret;
 
-	ret = -ENOMEM;
 	page = alloc_page(GFP_KERNEL | __GFP_ZERO);
 	if (!page)
-		goto out_err;
+		return -ENOMEM;
 
-	ret = 0;
 	kvm->coalesced_mmio_ring = page_address(page);
 
 	/*
@@ -128,8 +125,7 @@ int kvm_coalesced_mmio_init(struct kvm *kvm)
 	spin_lock_init(&kvm->ring_lock);
 	INIT_LIST_HEAD(&kvm->coalesced_zones);
 
-out_err:
-	return ret;
+	return 0;
 }
 
 void kvm_coalesced_mmio_free(struct kvm *kvm)
-- 
2.19.1


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

* Re: [PATCH] KVM: MMIO: get rid of odd out_err label in kvm_coalesced_mmio_init
  2019-11-09  8:08 [PATCH] KVM: MMIO: get rid of odd out_err label in kvm_coalesced_mmio_init linmiaohe
@ 2019-11-11 14:07 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2019-11-11 14:07 UTC (permalink / raw)
  To: linmiaohe, rkrcmar; +Cc: kvm, linux-kernel

On 09/11/19 09:08, linmiaohe wrote:
> From: Miaohe Lin <linmiaohe@huawei.com>
> 
> The out_err label and var ret is unnecessary, clean them up.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  virt/kvm/coalesced_mmio.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/virt/kvm/coalesced_mmio.c b/virt/kvm/coalesced_mmio.c
> index 8ffd07e2a160..00c747dbc82e 100644
> --- a/virt/kvm/coalesced_mmio.c
> +++ b/virt/kvm/coalesced_mmio.c
> @@ -110,14 +110,11 @@ static const struct kvm_io_device_ops coalesced_mmio_ops = {
>  int kvm_coalesced_mmio_init(struct kvm *kvm)
>  {
>  	struct page *page;
> -	int ret;
>  
> -	ret = -ENOMEM;
>  	page = alloc_page(GFP_KERNEL | __GFP_ZERO);
>  	if (!page)
> -		goto out_err;
> +		return -ENOMEM;
>  
> -	ret = 0;
>  	kvm->coalesced_mmio_ring = page_address(page);
>  
>  	/*
> @@ -128,8 +125,7 @@ int kvm_coalesced_mmio_init(struct kvm *kvm)
>  	spin_lock_init(&kvm->ring_lock);
>  	INIT_LIST_HEAD(&kvm->coalesced_zones);
>  
> -out_err:
> -	return ret;
> +	return 0;
>  }
>  
>  void kvm_coalesced_mmio_free(struct kvm *kvm)
> 

Queued, thanks.

Paolo


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-09  8:08 [PATCH] KVM: MMIO: get rid of odd out_err label in kvm_coalesced_mmio_init linmiaohe
2019-11-11 14:07 ` Paolo Bonzini

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git