From: Vladimir Serbinenko Date: Tue, 27 Jan 2015 09:30:43 +0000 (+0100) Subject: fs/{cbfs,cpio}: Remove useless check if mode is NULL. X-Git-Tag: 2.02-beta3~469 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69a52e95d425502945fe43892cebf6b183290e6e;p=thirdparty%2Fgrub.git fs/{cbfs,cpio}: Remove useless check if mode is NULL. Callers already ensure that it's not null. Found by: Coverity Scan. --- diff --git a/grub-core/fs/cbfs.c b/grub-core/fs/cbfs.c index 4ddd6832f..a34eb88cb 100644 --- a/grub-core/fs/cbfs.c +++ b/grub-core/fs/cbfs.c @@ -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)) diff --git a/grub-core/fs/cpio_common.c b/grub-core/fs/cpio_common.c index 20230a741..50fea47d1 100644 --- a/grub-core/fs/cpio_common.c +++ b/grub-core/fs/cpio_common.c @@ -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)