util/nvmutil: show total number of bytes read

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2025-01-27 05:02:54 +00:00
parent 97beb4305b
commit 67ac52df84
1 changed files with 6 additions and 0 deletions

View File

@ -221,6 +221,8 @@ readGbe(void)
gbe[0] = (size_t) buf;
gbe[1] = gbe[0] + (nf * (do_read[0] & do_read[1]));
ssize_t tnr = 0; /* total bytes read */
for (int p = 0; p < 2; p++) {
if (!do_read[p])
continue; /* avoid unnecessary reads */
@ -232,8 +234,12 @@ readGbe(void)
"%ld bytes written on '%s', expected %ld bytes\n",
nr, filename, nf);
tnr += nr;
swap(p); /* handle big-endian host CPU */
}
printf("%ld bytes read from file '%s'\n", tnr, filename);
}
/* set MAC address and checksum on nvm part */