summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-03 16:43:48 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-03 16:43:48 +0000
commitb03a532c7dfee56c2be005d4319a205ddd761ed0 (patch)
treed7de4f57609d112c41d6d9f0e0e872f517d37227
parent5bae73c3197fe38a4afa0ef7cce5938b4d2340e8 (diff)
util/nvmutil: use braces on nested ifs
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 86aa09c8..300ba040 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -178,9 +178,10 @@ set_io_flags(int argc, char *argv[])
const char *arg_cmd = argv[2];
flags = O_RDWR;
- if (argc > 2)
+ if (argc > 2) {
if (strcmp(arg_cmd, "dump") == 0)
flags = O_RDONLY;
+ }
}
static void
@@ -243,9 +244,10 @@ read_gbe(void)
if ((cmd == cmd_copy) || (cmd == cmd_swap))
invert = 1;
- for (p = 0; p < 2; p++)
+ for (p = 0; p < 2; p++) {
if (do_read[p])
read_gbe_part(p, invert);
+ }
}
static void
@@ -325,11 +327,12 @@ set_mac_nib(int mac_pos, int nib, uint8_t *h)
mac[mac_pos + nib]);
/* If random, ensure that local/unicast bits are set */
- if ((byte == 0) && (nib == 1))
+ if ((byte == 0) && (nib == 1)) {
if ((mac[mac_pos + nib] == '?') ||
(mac[mac_pos + nib] == 'x') ||
(mac[mac_pos + nib] == 'X')) /* random */
*h = (*h & 0xE) | 2; /* local, unicast */
+ }
macbuf[byte >> 1] |= ((uint16_t ) *h) << ((8 * (byte % 2)) +
(4 * (nib ^ 1)));
@@ -346,7 +349,8 @@ hextonum(char ch)
return ch - 'a' + 10;
else if ((ch == '?') || (ch == 'x') || (ch == 'X'))
return rhex(); /* random hex value */
- return 16; /* error: invalid character */
+ else
+ return 16; /* error: invalid character */
}
static uint8_t