diff mbox series

[1/3] partitions/ibm: Remove unnecessary memset

Message ID 20230915131001.697070-2-sth@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series partitions/ibm: Replace strncpy() and cleanups | expand

Commit Message

Stefan Haberland Sept. 15, 2023, 1:09 p.m. UTC
From: Jan Höppner <hoeppner@linux.ibm.com>

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>
---
 block/partitions/ibm.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/block/partitions/ibm.c b/block/partitions/ibm.c
index 403756dbd50d..49eb0e354fc4 100644
--- a/block/partitions/ibm.c
+++ b/block/partitions/ibm.c
@@ -124,8 +124,6 @@  static int find_label(struct parsed_partitions *state,
 			break;
 		}
 	}
-	if (!found)
-		memset(label, 0, sizeof(*label));
 
 	return found;
 }