From 67035605b931fab87fc0945064da21b9b5a28b15 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sun, 24 Apr 2016 17:30:37 +0000 Subject: [PATCH] lib/vfs/direntry.c: cleanup cppcheck warnings. Cleanup following cppcheck warnings: [lib/vfs/direntry.c:121]: (style) Clarify calculation precedence for '&' and '?'. [lib/vfs/direntry.c:386]: (style) Clarify calculation precedence for '&' and '?'. [lib/vfs/direntry.c:391]: (style) Clarify calculation precedence for '&' and '?'. Signed-off-by: Andreas Mohr Signed-off-by: Andrew Borodin --- lib/vfs/direntry.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/vfs/direntry.c b/lib/vfs/direntry.c index 66742b562..46cbcb211 100644 --- a/lib/vfs/direntry.c +++ b/lib/vfs/direntry.c @@ -118,7 +118,7 @@ vfs_s_automake (struct vfs_class *me, struct vfs_s_inode *dir, char *path, int f if (sep != NULL) *sep = '\0'; - res = vfs_s_generate_entry (me, path, dir, flags & FL_MKDIR ? (0777 | S_IFDIR) : 0777); + res = vfs_s_generate_entry (me, path, dir, (flags & FL_MKDIR) != 0 ? (0777 | S_IFDIR) : 0777); vfs_s_insert_entry (me, dir, res); if (sep != NULL) @@ -383,13 +383,14 @@ vfs_s_inode_from_path (const vfs_path_t * vpath, int flags) ino = vfs_s_find_inode (path_element->class, super, q, - flags & FL_FOLLOW ? LINK_FOLLOW : LINK_NO_FOLLOW, flags & ~FL_FOLLOW); + (flags & FL_FOLLOW) != 0 ? LINK_FOLLOW : LINK_NO_FOLLOW, + flags & ~FL_FOLLOW); if ((!ino) && (!*q)) /* We are asking about / directory of ftp server: assume it exists */ ino = vfs_s_find_inode (path_element->class, super, q, - flags & FL_FOLLOW ? LINK_FOLLOW : - LINK_NO_FOLLOW, FL_DIR | (flags & ~FL_FOLLOW)); + (flags & FL_FOLLOW) != 0 ? LINK_FOLLOW : LINK_NO_FOLLOW, + FL_DIR | (flags & ~FL_FOLLOW)); return ino; }