summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-03 14:37:10 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-03 14:37:10 +0000
commit4edcc26849181bef2b83f64676d164635528a167 (patch)
tree4fdeef67bfead03c0ac67446b6761b6cdc779bee /util/nvmutil
parent91879b7606ed3af26dabe60c043acbc7e4dbcde5 (diff)
util/nvmutil: make global variable names clearer
each variable is declared on its own line. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 08370e5b..32be3102 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -43,10 +43,17 @@ uint16_t word(int, int);
uint8_t buf[SIZE_8KB];
uint16_t macbuf[3] = {0, 0, 0};
size_t partsize;
-int flags, rfd, fd, part, e = 1, invert = 0;
+
+int flags;
+int rfd;
+int fd;
+int part;
+int invert = 0;
int part_modified[2] = {0, 0};
-const char *mac = NULL, *rmac = "xx:xx:xx:xx:xx:xx", *fname = "";
+const char *mac = NULL;
+const char *rmac = "xx:xx:xx:xx:xx:xx";
+const char *fname = "";
typedef struct op {
char *str;
@@ -54,13 +61,20 @@ typedef struct op {
int args;
} op_t;
op_t op[] = {
-{ .str = "dump", .cmd = cmd_dump, .args = 3 },
-{ .str = "setmac", .cmd = cmd_setmac, .args = 3 },
-{ .str = "swap", .cmd = cmd_swap, .args = 3 },
-{ .str = "copy", .cmd = cmd_copy, .args = 4 },
-{ .str = "brick", .cmd = cmd_brick, .args = 4 },
-{ .str = "setchecksum", .cmd = cmd_setchecksum, .args = 4 },
+ { .str = "dump",
+ .cmd = cmd_dump, .args = 3 },
+ { .str = "setmac",
+ .cmd = cmd_setmac, .args = 3 },
+ { .str = "swap",
+ .cmd = cmd_swap, .args = 3 },
+ { .str = "copy",
+ .cmd = cmd_copy, .args = 4 },
+ { .str = "brick",
+ .cmd = cmd_brick, .args = 4 },
+ { .str = "setchecksum",
+ .cmd = cmd_setchecksum, .args = 4 },
};
+
void (*cmd)(void) = NULL;
int
@@ -468,6 +482,7 @@ write_gbe_part(int p)
void
swap(int partnum)
{
+ int e = 1;
uint8_t *n = buf + (SIZE_4KB * partnum);
for (size_t w = NVM_SIZE * ((uint8_t *) &e)[0], x = 1;