partitions/ibm: Remove unnecessary memset
authorJan Höppner <hoeppner@linux.ibm.com>
Fri, 15 Sep 2023 13:09:59 +0000 (15:09 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 4 Oct 2023 14:04:08 +0000 (08:04 -0600)
The data holding the volume label information is zeroed in case no valid
volume label was found. Since the label information isn't used in that
case, zeroing the data doesn't provide any value whatsoever.

Remove the unnecessary memset() call accordingly.

Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://lore.kernel.org/r/20230915131001.697070-2-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/partitions/ibm.c

index 403756dbd50d9aeb6b2f51266d2b875844ef18d2..49eb0e354fc4b793eac5258eab653cf3c9145925 100644 (file)
@@ -124,8 +124,6 @@ static int find_label(struct parsed_partitions *state,
                        break;
                }
        }
-       if (!found)
-               memset(label, 0, sizeof(*label));
 
        return found;
 }