Remove an unuseful if check in ext4.c.
authorFan Deng <enetor@gmail.com>
Tue, 17 Oct 2017 18:33:18 +0000 (11:33 -0700)
committerFan Deng <enetor@gmail.com>
Tue, 17 Oct 2017 18:33:18 +0000 (11:33 -0700)
The if check on s_bdevices[i].name is unuseful, as 'name' always
evaluates to true:
    if (s_bdevices[i].name) {
        ...
    }
This change removes the check to be consistent with the rest of the code
(see line 124 and 144).

src/ext4.c

index 30d5bd81e5f9da33dcc0757f84e4f9d8f882ecee..b27ae6b758aef07e8dbf71ea7597ddb87c3abdc7 100644 (file)
@@ -379,11 +379,9 @@ int ext4_mount(const char *dev_name, const char *mount_point,
                return ENOTSUP;
 
        for (size_t i = 0; i < CONFIG_EXT4_BLOCKDEVS_COUNT; ++i) {
-               if (s_bdevices[i].name) {
-                       if (!strcmp(dev_name, s_bdevices[i].name)) {
-                               bd = s_bdevices[i].bd;
-                               break;
-                       }
+               if (!strcmp(dev_name, s_bdevices[i].name)) {
+                       bd = s_bdevices[i].bd;
+                       break;
                }
        }