diff options
| author | Leah Rowe <leah@libreboot.org> | 2025-01-27 05:02:54 +0000 | 
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2025-01-27 05:02:54 +0000 | 
| commit | bcf53cc2cc0c73ec99886fa8c6e4d43dba7b894c (patch) | |
| tree | 6117f7f2a4a61e34614668fbc181f0d3c43be6d5 /util/nvmutil | |
| parent | c91cc329cf8bdb8df55207908eb47cdcae3d3498 (diff) | |
util/nvmutil: show total number of bytes read
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 76ad14ce..f1004ae5 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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 */ | 
