]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: remove dead condition in Grow_reshape()
authorMateusz Kusiak <mateusz.kusiak@intel.com>
Tue, 20 Feb 2024 10:56:10 +0000 (11:56 +0100)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Fri, 23 Feb 2024 11:43:53 +0000 (12:43 +0100)
Remove dead "if" condition from Grow_reshape(). Sysfs read check is
performed earlier in the code.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Grow.c

diff --git a/Grow.c b/Grow.c
index 5498e54fec11eff34d8241ba121c41ce18039b1a..c69a342df945723671455e364354f2b9359323f9 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -2098,11 +2098,7 @@ int Grow_reshape(char *devname, int fd,
                        /* got truncated to 32bit, write to
                         * component_size instead
                         */
-                       if (sra)
-                               rv = sysfs_set_num(sra, NULL,
-                                                  "component_size", s->size);
-                       else
-                               rv = -1;
+                       rv = sysfs_set_num(sra, NULL, "component_size", s->size);
                } else {
                        rv = md_set_array_info(fd, &array);