diff mbox series

[04/19] RDMA/siw: Remove goto lable in siw_mmap

Message ID 20231009071801.10210-5-guoqing.jiang@linux.dev (mailing list archive)
State Superseded
Headers show
Series Cleanup for siw | expand

Commit Message

Guoqing Jiang Oct. 9, 2023, 7:17 a.m. UTC
Remove unnecessary label since the failure case only need to
print warning message.

Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
---
 drivers/infiniband/sw/siw/siw_verbs.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Bernard Metzler Oct. 25, 2023, 12:38 p.m. UTC | #1
> -----Original Message-----
> From: Guoqing Jiang <guoqing.jiang@linux.dev>
> Sent: Monday, October 9, 2023 9:18 AM
> To: Bernard Metzler <BMT@zurich.ibm.com>; jgg@ziepe.ca; leon@kernel.org
> Cc: linux-rdma@vger.kernel.org
> Subject: [EXTERNAL] [PATCH 04/19] RDMA/siw: Remove goto lable in siw_mmap
> 
> Remove unnecessary label since the failure case only need to
> print warning message.

I think you suggest removing it since the code falls through to the
useless label anyway and not since it prints a warning.

> 
> Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
> ---
>  drivers/infiniband/sw/siw/siw_verbs.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/siw/siw_verbs.c
> b/drivers/infiniband/sw/siw/siw_verbs.c
> index c5c27db9c2fe..dcd69fc01176 100644
> --- a/drivers/infiniband/sw/siw/siw_verbs.c
> +++ b/drivers/infiniband/sw/siw/siw_verbs.c
> @@ -66,12 +66,9 @@ int siw_mmap(struct ib_ucontext *ctx, struct
> vm_area_struct *vma)
>  	entry = to_siw_mmap_entry(rdma_entry);
> 
>  	rv = remap_vmalloc_range(vma, entry->address, 0);
> -	if (rv) {
> +	if (rv)
>  		pr_warn("remap_vmalloc_range failed: %lu, %zu\n", vma->vm_pgoff,
>  			size);
> -		goto out;
> -	}
> -out:
>  	rdma_user_mmap_entry_put(rdma_entry);
> 
>  	return rv;
> --
> 2.35.3

Thanks, makes sense!

Acked-by: Bernard Metzler <bmt@zurich.ibm.com>
Guoqing Jiang Oct. 26, 2023, 6:38 a.m. UTC | #2
On 10/25/23 20:38, Bernard Metzler wrote:
>> -----Original Message-----
>> From: Guoqing Jiang<guoqing.jiang@linux.dev>
>> Sent: Monday, October 9, 2023 9:18 AM
>> To: Bernard Metzler<BMT@zurich.ibm.com>;jgg@ziepe.ca;leon@kernel.org
>> Cc:linux-rdma@vger.kernel.org
>> Subject: [EXTERNAL] [PATCH 04/19] RDMA/siw: Remove goto lable in siw_mmap
>>
>> Remove unnecessary label since the failure case only need to
>> print warning message.
> I think you suggest removing it since the code falls through to the
> useless label anyway and not since it prints a warning.

Yes, exactly, sorry for the confusion. Will rephrase it to

"Let's remove it since the failure case only falls through
to the useless label."

>> Signed-off-by: Guoqing Jiang<guoqing.jiang@linux.dev>
>> ---
>>   drivers/infiniband/sw/siw/siw_verbs.c | 5 +----
>>   1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/infiniband/sw/siw/siw_verbs.c
>> b/drivers/infiniband/sw/siw/siw_verbs.c
>> index c5c27db9c2fe..dcd69fc01176 100644
>> --- a/drivers/infiniband/sw/siw/siw_verbs.c
>> +++ b/drivers/infiniband/sw/siw/siw_verbs.c
>> @@ -66,12 +66,9 @@ int siw_mmap(struct ib_ucontext *ctx, struct
>> vm_area_struct *vma)
>>   	entry = to_siw_mmap_entry(rdma_entry);
>>
>>   	rv = remap_vmalloc_range(vma, entry->address, 0);
>> -	if (rv) {
>> +	if (rv)
>>   		pr_warn("remap_vmalloc_range failed: %lu, %zu\n", vma->vm_pgoff,
>>   			size);
>> -		goto out;
>> -	}
>> -out:
>>   	rdma_user_mmap_entry_put(rdma_entry);
>>
>>   	return rv;
>> --
>> 2.35.3
> Thanks, makes sense!
>
> Acked-by: Bernard Metzler<bmt@zurich.ibm.com>

Thank you!

Guoqing
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/siw/siw_verbs.c b/drivers/infiniband/sw/siw/siw_verbs.c
index c5c27db9c2fe..dcd69fc01176 100644
--- a/drivers/infiniband/sw/siw/siw_verbs.c
+++ b/drivers/infiniband/sw/siw/siw_verbs.c
@@ -66,12 +66,9 @@  int siw_mmap(struct ib_ucontext *ctx, struct vm_area_struct *vma)
 	entry = to_siw_mmap_entry(rdma_entry);
 
 	rv = remap_vmalloc_range(vma, entry->address, 0);
-	if (rv) {
+	if (rv)
 		pr_warn("remap_vmalloc_range failed: %lu, %zu\n", vma->vm_pgoff,
 			size);
-		goto out;
-	}
-out:
 	rdma_user_mmap_entry_put(rdma_entry);
 
 	return rv;