util/nvmutil: rename gbe_bound for clarity

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-06 17:47:49 +00:00
parent b1abef8881
commit 41f7f6352d

View File

@@ -46,7 +46,7 @@ static void set_word(size_t, int, uint16_t);
static void check_bound(size_t, int);
static void write_gbe(void);
static void write_gbe_part(int);
static off_t gbe_bound(int, const char *);
static off_t gbe_file_offset(int, const char *);
static void usage(void);
static void err(int, const char *, ...);
static const char *getnvmprogname(void);
@@ -369,7 +369,7 @@ static void
read_gbe_part(int p, int invert)
{
read_file_PERFECTLY_or_die(fd, buf + (GBE_PART_SIZE * (p ^ invert)),
GBE_PART_SIZE, gbe_bound(p, "pread"), fname, "pread");
GBE_PART_SIZE, gbe_file_offset(p, "pread"), fname, "pread");
}
static void
@@ -772,7 +772,7 @@ static void
write_gbe_part(int p)
{
if (pwrite(fd, buf + (GBE_PART_SIZE * p),
GBE_PART_SIZE, gbe_bound(p, "pwrite")) != GBE_PART_SIZE) {
GBE_PART_SIZE, gbe_file_offset(p, "pwrite")) != GBE_PART_SIZE) {
err(ECANCELED,
"Can't write %d b to '%s' p%d", GBE_PART_SIZE, fname, p);
}
@@ -787,7 +787,7 @@ write_gbe_part(int p)
* This check is called, to ensure just that.
*/
static off_t
gbe_bound(int p, const char *f_op)
gbe_file_offset(int p, const char *f_op)
{
off_t off = (off_t)p * partsize;