diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-06 19:08:55 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-06 19:08:55 +0000 |
| commit | efdf1103178baf8577cbc57f4bcbcb2e63bc135c (patch) | |
| tree | 3a4e59d0802ebd515b836675c4531681aec3e9c1 /util/nvmutil/nvmutil.c | |
| parent | d94fbba779e5838c037922f4a56463fb3cf78a4e (diff) | |
util/nvmutil: remove unnecessary casts
now that part numbers are size_t, i don't need them.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 3b1e16c2..5b8db596 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -700,9 +700,9 @@ word(size_t pos16, size_t p) size_t pos; check_bound(pos16, p); - pos = (pos16 << 1) + ((size_t)p * GBE_PART_SIZE); + pos = (pos16 << 1) + (p * GBE_PART_SIZE); - return (uint16_t)buf[pos] | ((uint16_t)buf[pos + 1] << 8); + return buf[pos] | (buf[pos + 1] << 8); } static void @@ -711,7 +711,7 @@ set_word(size_t pos16, size_t p, uint16_t val16) size_t pos; check_bound(pos16, p); - pos = (pos16 << 1) + ((size_t)p * GBE_PART_SIZE); + pos = (pos16 << 1) + (p * GBE_PART_SIZE); buf[pos] = (uint8_t)(val16 & 0xff); buf[pos + 1] = (uint8_t)(val16 >> 8); @@ -806,7 +806,7 @@ gbe_x_offset(size_t p, const char *f_op, const char *d_type, { off_t off = (off_t)p * nsize; - if ((unsigned int)p > 1) + if (p > 1) err(ECANCELED, "GbE %s %s invalid partnum: %s", d_type, f_op, fname); |
