From 1290662034578b4e52443c79f34dfd7c284c0435 Mon Sep 17 00:00:00 2001 From: Yann Gautier <yann.gautier@st.com> Date: Tue, 21 Jun 2022 14:34:00 +0200 Subject: [PATCH] fix(partition): add missing curly braces Add braces to correct MISRA C2012 15.6 warning: The body of an iteration-statement or a selection-statement shall be a compound-statement. Signed-off-by: Yann Gautier <yann.gautier@st.com> Change-Id: I4041b0080b678f5ffdbe074e3cee9ac0afd5e176 --- drivers/partition/gpt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/partition/gpt.c b/drivers/partition/gpt.c index 4fe832244..8b1046d00 100644 --- a/drivers/partition/gpt.c +++ b/drivers/partition/gpt.c @@ -26,14 +26,16 @@ static int unicode_to_ascii(unsigned short *str_in, unsigned char *str_out) /* check whether the unicode string is valid */ for (i = 1; i < (EFI_NAMELEN << 1); i += 2) { - if (name[i] != '\0') + if (name[i] != '\0') { return -EINVAL; + } } /* convert the unicode string to ascii string */ for (i = 0; i < (EFI_NAMELEN << 1); i += 2) { str_out[i >> 1] = name[i]; - if (name[i] == '\0') + if (name[i] == '\0') { break; + } } return 0; }