Skip to contentSkip to conversation

fstests: solve no-return-in-nonvoid-function issue

PATCH In review Yong Sun 3 participants 3 messages Apr 24, 2024 – Apr 27, 2024

lore
Share & tools
lore

Yong Sun

author
#0 lore raw

PATCH 1/1 fstests: solve no-return-in-nonvoid-function issue

When build xfstests in some platform it will return no-return-in-nonvoid-function error in dio-buf-fault.c:83 and fake-dump-rootino.c:224, add return value to solve the issue.

---
 src/dio-buf-fault.c     | 2 +-
 src/fake-dump-rootino.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
src/dio-buf-fault.c +1 -1
index 911c3e1f..6b07c729 100644
@@ -79,5 +79,5 @@ int main(int argc, char *argv[]) {
 	c = ((char *)buf)[0];
 	printf("%u\n", c);
 
-	do_dio(argv[2], buf, sz);
+	return do_dio(argv[2], buf, sz);
 }
src/fake-dump-rootino.c +1 -0
index 8a30dffd..cada223a 100644
@@ -221,4 +221,5 @@ int main(int argc, char *argv[]) {
 
 	munmap(header, GLOBAL_HDR_SZ);
 	close(fd);
+        return 0;
 }
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw

src/fake-dump-rootino.c int main(int argc, char *argv[]) { · line 224

Quoted 7 lines · Yong Sun
src/fake-dump-rootino.c +1 -0
@@ -221,4 +221,5 @@ int main(int argc, char *argv[]) {
 
 	munmap(header, GLOBAL_HDR_SZ);
 	close(fd);
+        return 0;

This needs to use a tab instead of spaces. Otherwise looks good:

Reviewed-by
#2 lore raw
Quoted 10 lines · Christoph Hellwig

src/fake-dump-rootino.c int main(int argc, char *argv[]) { · line 224

Quoted 7 lines · Yong Sun
src/fake-dump-rootino.c +1 -0
@@ -221,4 +221,5 @@ int main(int argc, char *argv[]) {
 
 	munmap(header, GLOBAL_HDR_SZ);
 	close(fd);
+        return 0;

This needs to use a tab instead of spaces. Otherwise looks good:

Yes, I'll help to change that, thanks!

Quoted 3 lines