Skip to contentSkip to conversation

lib/scatterlist: use consistent sg_copy_buffer() return type

PATCH Applied David Disseldorp 3 participants 4 messages Oct 26, 2020 – Oct 29, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/scatterlist: use consistent sg_copy_buffer() return type

sg_copy_buffer() returns a size_t with the number of bytes copied. Return 0 instead of false if the copy is skipped.

---
 lib/scatterlist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/scatterlist.c +1 -1
index 0a482ef988e5..a59778946404 100644
@@ -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;
Signature · 1 line
2.26.2
#1 lore raw

Ping - is there any feedback on this trivial change?

Quoted 22 lines · David Disseldorp

sg_copy_buffer() returns a size_t with the number of bytes copied. Return 0 instead of false if the copy is skipped.

---
 lib/scatterlist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/scatterlist.c +1 -1
index 0a482ef988e5..a59778946404 100644
@@ -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;
maintainer Applied
#3 lore raw
In reply to David Disseldorp
Quoted 2 lines · David Disseldorp

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.

Signature · 1 line
Jens Axboe