summaryrefslogtreecommitdiff
path: root/util/nvmutil/lib/checksum.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-19 16:02:15 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-19 16:02:15 +0000
commit55f006318a35990d7d19a796e9af4c5f351b389a (patch)
tree3a3cc47a97a52b9bbd534821ac1b67c7d08e0bc8 /util/nvmutil/lib/checksum.c
parent7ad924a91f6800de4fdd89dbc390d6c46d78a861 (diff)
tidy some comments
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/lib/checksum.c')
-rw-r--r--util/nvmutil/lib/checksum.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/util/nvmutil/lib/checksum.c b/util/nvmutil/lib/checksum.c
index 465b76bf..8565361b 100644
--- a/util/nvmutil/lib/checksum.c
+++ b/util/nvmutil/lib/checksum.c
@@ -1,10 +1,7 @@
/* SPDX-License-Identifier: MIT
- *
* Copyright (c) 2022-2026 Leah Rowe <leah@libreboot.org>
*
* Functions related to GbE NVM checksums.
- *
- * Related file: word.c
*/
#include <sys/types.h>
@@ -42,15 +39,14 @@ read_checksums(void)
if (cmd->arg_part)
_max_invalid = 1;
- /*
- * Skip verification on this part,
+ /* Skip verification on this part,
* but only when arg_part is set.
*/
_skip_part = f->part ^ 1;
for (_p = 0; _p < 2; _p++) {
- /*
- * Only verify a part if it was *read*
+
+ /* Only verify a part if it was *read*
*/
if (cmd->arg_part && (_p == _skip_part))
continue;
@@ -61,9 +57,11 @@ read_checksums(void)
}
if (_num_invalid >= _max_invalid) {
+
if (_max_invalid == 1)
err(ECANCELED, "%s: part %lu has a bad checksum",
f->fname, (unsigned long)f->part);
+
err(ECANCELED, "%s: No valid checksum found in file",
f->fname);
}