linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib/scatterlist: use consistent sg_copy_buffer() return type
@ 2020-10-26 21:03 David Disseldorp
  2020-10-29 14:52 ` David Disseldorp
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Disseldorp @ 2020-10-26 21:03 UTC (permalink / raw)
  To: linux-block; +Cc: axboe, David Disseldorp, Douglas Gilbert

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;
-- 
2.26.2


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

* Re: [PATCH] lib/scatterlist: use consistent sg_copy_buffer() return type
  2020-10-26 21:03 [PATCH] lib/scatterlist: use consistent sg_copy_buffer() return type David Disseldorp
@ 2020-10-29 14:52 ` David Disseldorp
  2020-10-29 14:54 ` Johannes Thumshirn
  2020-10-29 14:56 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: David Disseldorp @ 2020-10-29 14:52 UTC (permalink / raw)
  To: linux-block; +Cc: axboe, Douglas Gilbert

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;


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

* Re: [PATCH] lib/scatterlist: use consistent sg_copy_buffer() return type
  2020-10-26 21:03 [PATCH] lib/scatterlist: use consistent sg_copy_buffer() return type David Disseldorp
  2020-10-29 14:52 ` David Disseldorp
@ 2020-10-29 14:54 ` Johannes Thumshirn
  2020-10-29 14:56 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Johannes Thumshirn @ 2020-10-29 14:54 UTC (permalink / raw)
  To: David Disseldorp, linux-block; +Cc: axboe, Douglas Gilbert

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

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

* Re: [PATCH] lib/scatterlist: use consistent sg_copy_buffer() return type
  2020-10-26 21:03 [PATCH] lib/scatterlist: use consistent sg_copy_buffer() return type David Disseldorp
  2020-10-29 14:52 ` David Disseldorp
  2020-10-29 14:54 ` Johannes Thumshirn
@ 2020-10-29 14:56 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2020-10-29 14:56 UTC (permalink / raw)
  To: David Disseldorp, linux-block; +Cc: Douglas Gilbert

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.

-- 
Jens Axboe


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

end of thread, other threads:[~2020-10-29 14:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 21:03 [PATCH] lib/scatterlist: use consistent sg_copy_buffer() return type David Disseldorp
2020-10-29 14:52 ` David Disseldorp
2020-10-29 14:54 ` Johannes Thumshirn
2020-10-29 14:56 ` Jens Axboe

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).