KVM: MMIO: get rid of odd out_err label in kvm_coalesced_mmio_init
diff mbox series

Message ID 1573286900-19041-1-git-send-email-linmiaohe@huawei.com
State New
Headers show
Series
  • KVM: MMIO: get rid of odd out_err label in kvm_coalesced_mmio_init
Related show

Commit Message

linmiaohe Nov. 9, 2019, 8:08 a.m. UTC
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(-)

Comments

Paolo Bonzini Nov. 11, 2019, 2:07 p.m. UTC | #1
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

Patch
diff mbox series

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)