linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] create_inode: fix gcc -Wall complaints
@ 2014-03-12  3:41 Theodore Ts'o
  2014-03-12  3:45 ` Theodore Ts'o
  0 siblings, 1 reply; 10+ messages in thread
From: Theodore Ts'o @ 2014-03-12  3:41 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o

We had several functions that were not returning zero on success.  Fix
this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 misc/create_inode.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/misc/create_inode.c b/misc/create_inode.c
index 42ac6b2..964c66a 100644
--- a/misc/create_inode.c
+++ b/misc/create_inode.c
@@ -86,10 +86,9 @@ static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t cwd,
 	fill_inode(&inode, st);
 
 	retval = ext2fs_write_inode(fs, ino, &inode);
-	if (retval) {
+	if (retval)
 		com_err(__func__, retval, "while writing inode %u", ino);
-		return retval;
-	}
+	return retval;
 }
 
 /* Make a special file which is block, character and fifo */
@@ -115,6 +114,9 @@ errcode_t do_mknod_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name,
 		mode = LINUX_S_IFIFO;
 		filetype = EXT2_FT_FIFO;
 		break;
+	default:
+		abort();
+		/* NOTREACHED */
 	}
 
 	if (!(fs->flags & EXT2_FLAG_RW)) {
@@ -204,11 +206,9 @@ try_again:
 		}
 		goto try_again;
 	}
-	if (retval) {
+	if (retval)
 		com_err("ext2fs_symlink", retval, 0);
-		return retval;
-	}

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

end of thread, other threads:[~2014-03-13  2:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-12  3:41 [PATCH] create_inode: fix gcc -Wall complaints Theodore Ts'o
2014-03-12  3:45 ` Theodore Ts'o
2014-03-12  3:48   ` Darrick J. Wong
2014-03-12  6:33     ` Robert Yang
2014-03-12  6:34       ` Robert Yang
2014-03-12 14:32     ` Theodore Ts'o
2014-03-12 17:59       ` Darrick J. Wong
2014-03-12 20:02       ` Darrick J. Wong
2014-03-12 20:51         ` Theodore Ts'o
2014-03-13  2:21           ` Robert Yang

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