summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-10 06:11:31 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-10 06:11:31 +0000
commit2fda988da6e5f70da30d350ca9253f0d15008fc7 (patch)
treeba536c1809e772374b6f74e691461e2d13d1d181 /util/nvmutil/nvmutil.c
parentba3cf14faa0c1e55e82d92795a07ec82eb121fcf (diff)
util/nvmutil: make rc size_t (not ssize_t)
i overlooked this when writing. it's comparing to a length which is size_t, so let's avoid an unnecessary cast. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r--util/nvmutil/nvmutil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 272091a6..d800ea39 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1335,7 +1335,7 @@ rw_file_exact(int fd, uint8_t *mem, size_t len,
const char *rw_type_str)
{
ssize_t rval = -1;
- ssize_t rc = 0;
+ size_t rc = 0;
if (fd < 0)
err(EIO, "%s: %s: Bad fd %d", path, rw_type_str, fd);
@@ -1346,7 +1346,7 @@ rw_file_exact(int fd, uint8_t *mem, size_t len,
"%s: %s: Requested length (%zu) exceeds SSIZE_MAX (%zd)",
path, rw_type_str, len, SSIZE_MAX);
- for (rc = 0; rc != (ssize_t)len; rc += rval) {
+ for (rc = 0; rc != len; rc += rval) {
if (rw_type == PSCHREIB)
rval = pwrite(fd, mem + rc, len - rc, off + rc);
else if (rw_type == SCHREIB)