lib/scatterlist: use consistent sg_copy_buffer() return type
authorDavid Disseldorp <ddiss@suse.de>
Mon, 26 Oct 2020 21:03:10 +0000 (22:03 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 29 Oct 2020 14:55:45 +0000 (08:55 -0600)
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>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/scatterlist.c

index 0a482ef..a597789 100644 (file)
@@ -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;