diff mbox series

lib/scatterlist: use consistent sg_copy_buffer() return type

Message ID 20201026210310.30169-1-ddiss@suse.de (mailing list archive)
State New, archived
Headers show
Series lib/scatterlist: use consistent sg_copy_buffer() return type | expand

Commit Message

David Disseldorp Oct. 26, 2020, 9:03 p.m. UTC
sg_copy_buffer() returns a size_t with the number of bytes copied.
Return 0 instead of false if the copy is skipped.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
---
 lib/scatterlist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Disseldorp Oct. 29, 2020, 2:52 p.m. UTC | #1
Ping - is there any feedback on this trivial change?

On Mon, 26 Oct 2020 22:03:10 +0100, David Disseldorp wrote:

> sg_copy_buffer() returns a size_t with the number of bytes copied.
> Return 0 instead of false if the copy is skipped.
> 
> Signed-off-by: David Disseldorp <ddiss@suse.de>
> Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
> ---
>  lib/scatterlist.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/scatterlist.c b/lib/scatterlist.c
> index 0a482ef988e5..a59778946404 100644
> --- a/lib/scatterlist.c
> +++ b/lib/scatterlist.c
> @@ -933,7 +933,7 @@ size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
>  	sg_miter_start(&miter, sgl, nents, sg_flags);
>  
>  	if (!sg_miter_skip(&miter, skip))
> -		return false;
> +		return 0;
>  
>  	while ((offset < buflen) && sg_miter_next(&miter)) {
>  		unsigned int len;
Johannes Thumshirn Oct. 29, 2020, 2:54 p.m. UTC | #2
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Jens Axboe Oct. 29, 2020, 2:56 p.m. UTC | #3
On 10/26/20 3:03 PM, David Disseldorp wrote:
> sg_copy_buffer() returns a size_t with the number of bytes copied.
> Return 0 instead of false if the copy is skipped.

I've picked this up, thanks.
diff mbox series

Patch

diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 0a482ef988e5..a59778946404 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -933,7 +933,7 @@  size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, void *buf,
 	sg_miter_start(&miter, sgl, nents, sg_flags);
 
 	if (!sg_miter_skip(&miter, skip))
-		return false;
+		return 0;
 
 	while ((offset < buflen) && sg_miter_next(&miter)) {
 		unsigned int len;