From 9b6f2a2f7ec8873536226b333de492356c1c2663 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 6 Mar 2026 22:39:43 +0000 Subject: util/nvmutil: rename check_bound check_nvm_bound this makes the intent clearer, because we only want to access the 128-byte nvm area here. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index c4fe6259..f64c6468 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -59,7 +59,7 @@ static void cmd_swap(void); static int good_checksum(size_t partnum); static uint16_t word(size_t pos16, size_t part); static void set_word(size_t pos16, size_t part, uint16_t val16); -static void check_bound(size_t pos16, size_t part); +static void check_nvm_bound(size_t pos16, size_t part); static void write_gbe_file(void); static void write_gbe_file_part(size_t part); static off_t gbe_file_offset(size_t part, const char *f_op); @@ -759,7 +759,7 @@ word(size_t pos16, size_t p) { size_t pos; - check_bound(pos16, p); + check_nvm_bound(pos16, p); pos = (pos16 << 1) + (p * GBE_PART_SIZE); return buf[pos] | (buf[pos + 1] << 8); @@ -770,7 +770,7 @@ set_word(size_t pos16, size_t p, uint16_t val16) { size_t pos; - check_bound(pos16, p); + check_nvm_bound(pos16, p); pos = (pos16 << 1) + (p * GBE_PART_SIZE); buf[pos] = (uint8_t)(val16 & 0xff); @@ -780,7 +780,7 @@ set_word(size_t pos16, size_t p, uint16_t val16) } static void -check_bound(size_t c, size_t p) +check_nvm_bound(size_t c, size_t p) { /* * NVM_SIZE assumed as the limit, because the @@ -789,7 +789,7 @@ check_bound(size_t c, size_t p) * * The only exception is copy/swap, but these * do not use word/set_word and therefore do - * not cause check_bound() to be called. + * not cause check_nvm_bound() to be called. * * TODO: * This should be adjusted in the future, if @@ -799,7 +799,7 @@ check_bound(size_t c, size_t p) check_part_num(p); if (c >= NVM_WORDS) - err(EINVAL, "check_bound: out of bounds %zu", c); + err(EINVAL, "check_nvm_bound: out of bounds %zu", c); } static void -- cgit v1.2.1