]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
fs/{cbfs,cpio}: Remove useless check if mode is NULL.
authorVladimir Serbinenko <phcoder@gmail.com>
Tue, 27 Jan 2015 09:30:43 +0000 (10:30 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Tue, 27 Jan 2015 15:32:21 +0000 (16:32 +0100)
Callers already ensure that it's not null.

Found by: Coverity Scan.

grub-core/fs/cbfs.c
grub-core/fs/cpio_common.c

index 4ddd6832fa8a750e66c512efa4583c71c79faa1b..a34eb88cba5e84239dde1a0c23fe1fa0ed546c0c 100644 (file)
@@ -74,8 +74,7 @@ grub_cbfs_find_file (struct grub_archelp_data *data, char **name,
       (void) mtime;
       offset = grub_be_to_cpu32 (hd.offset);
 
-      if (mode)
-       *mode = GRUB_ARCHELP_ATTR_FILE | GRUB_ARCHELP_ATTR_NOTIME;
+      *mode = GRUB_ARCHELP_ATTR_FILE | GRUB_ARCHELP_ATTR_NOTIME;
 
       namesize = offset;
       if (namesize >= sizeof (hd))
index 20230a7411d2bdf00f74bf830854baaca7851418..50fea47d1819bbb1070499baa04f9679ac774f0c 100644 (file)
@@ -69,8 +69,7 @@ grub_cpio_find_file (struct grub_archelp_data *data, char **name,
       return GRUB_ERR_NONE;
     }
 
-  if (mode)
-    *mode = modeval;
+  *mode = modeval;
 
   *name = grub_malloc (namesize + 1);
   if (*name == NULL)