summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-03 13:38:39 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-03 13:38:39 +0000
commit8812a176834aeedd1abc7d60c8e8af4b814a8850 (patch)
tree63fe897c0f58677a204b50f4d367c2c48b361503 /util
parent3bdefad0977986e4f70ca609a4c926b16fe76b43 (diff)
util/nvmutil: use the invert in goodChecksum
this way, the correct part number is printed when an invalid part is being operated on, in cmd copy or swap. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 3bc2a4d1..c5611257 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -42,7 +42,7 @@ uint16_t word(int, int);
uint8_t buf[SIZE_8KB];
uint16_t mac[3] = {0, 0, 0};
size_t partsize;
-int flags, rfd, fd, part, e = 1;
+int flags, rfd, fd, part, e = 1, invert = 0;
int nvmPartModified[2] = {0, 0};
const char *strMac = NULL, *strRMac = "xx:xx:xx:xx:xx:xx", *fname = "";
@@ -185,7 +185,6 @@ xopen(int *f, const char *l, int p, struct stat *st)
void
readGbe(void)
{
- int invert = 0;
int do_read[2] = {1, 1};
if ((cmd == cmd_copy) || (cmd == cmd_brick) || (cmd == cmd_setchecksum))
@@ -413,7 +412,7 @@ goodChecksum(int partnum)
if (total == NVM_CHECKSUM)
return 1;
- fprintf(stderr, "WARNING: BAD checksum in part %d\n", partnum);
+ fprintf(stderr, "WARNING: BAD checksum in part %d\n", partnum ^ invert);
(void) set_err(ECANCELED);
return 0;
}