diff mbox series

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

Message ID 20240424112444.20964-1-yosun@suse.com (mailing list archive)
State New, archived
Headers show
Series fstests: solve no-return-in-nonvoid-function issue | expand

Commit Message

Yong Sun April 24, 2024, 11:24 a.m. UTC
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.

Signed-off-by: Yong Sun <yosun@suse.com>
---
 src/dio-buf-fault.c     | 2 +-
 src/fake-dump-rootino.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Christoph Hellwig April 27, 2024, 5:52 a.m. UTC | #1
On Wed, Apr 24, 2024 at 07:24:08PM +0800, Yong Sun wrote:
> --- a/src/fake-dump-rootino.c
> +++ b/src/fake-dump-rootino.c
> @@ -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: Christoph Hellwig <hch@lst.de>
Zorro Lang April 27, 2024, 8:41 a.m. UTC | #2
On Fri, Apr 26, 2024 at 10:52:59PM -0700, Christoph Hellwig wrote:
> On Wed, Apr 24, 2024 at 07:24:08PM +0800, Yong Sun wrote:
> > --- a/src/fake-dump-rootino.c
> > +++ b/src/fake-dump-rootino.c
> > @@ -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!

Reviewed-by: Zorro Lang <zlang@redhat.com>

> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
diff mbox series

Patch

diff --git a/src/dio-buf-fault.c b/src/dio-buf-fault.c
index 911c3e1f..6b07c729 100644
--- a/src/dio-buf-fault.c
+++ b/src/dio-buf-fault.c
@@ -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);
 }
diff --git a/src/fake-dump-rootino.c b/src/fake-dump-rootino.c
index 8a30dffd..cada223a 100644
--- a/src/fake-dump-rootino.c
+++ b/src/fake-dump-rootino.c
@@ -221,4 +221,5 @@  int main(int argc, char *argv[]) {
 
 	munmap(header, GLOBAL_HDR_SZ);
 	close(fd);
+        return 0;
 }