From 96356ce94f66ee55a35d40e2098ebb9bfba173c7 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 29 Jan 2025 03:47:20 +0000 Subject: util/nvmutil: move "e" to swap() we only use it there, so we should only define it there. it's used to detect host CPU endianness. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util/nvmutil/nvmutil.c') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 5ee990f2..0576167f 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -38,7 +38,7 @@ uint16_t mac[3] = {0, 0, 0}; ssize_t nf; size_t partsize, gbe[2]; uint8_t nvmPartChanged[2] = {0, 0}, do_read[2] = {1, 1}; -int e = 1, flags, rfd, fd, part; +int flags, rfd, fd, part; const char *strMac = NULL, *strRMac = "??:??:??:??:??:??", *filename = NULL; @@ -498,6 +498,7 @@ swap(int partnum) /* swaps bytes in words, not pointers. */ { /* not to be confused with cmd_swap */ size_t w, x; uint8_t *n = (uint8_t *) gbe[partnum]; + int e = 1; for (w = NVM_SIZE * ((uint8_t *) &e)[0], x = 1; w < NVM_SIZE; w += 2, x += 2) { -- cgit v1.2.1