From 493e3cf0697ddedb7cf576a92ba890315356a46a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 3 Mar 2026 20:38:36 +0000 Subject: util/nvmutil: explicitly cast on read/pread/pwrite these functions return ssize_t, so compare explicitly to that, when using the SIZE_4KB define for example. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util/nvmutil') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index c0089279..fb25af73 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -242,7 +242,7 @@ static void read_gbe_part(int p, int invert) { if (pread(fd, buf + (SIZE_4KB * (p ^ invert)), SIZE_4KB, p * partsize) - != SIZE_4KB) + != (ssize_t) SIZE_4KB) err(ECANCELED, "Can't read %d b from '%s' p%d", SIZE_4KB, fname, p); swap(p ^ invert); /* handle big-endian host CPU */ @@ -350,7 +350,7 @@ rhex(void) if (!n) { n = sizeof(rnum) - 1; if (read(rfd, (uint8_t *) &rnum, sizeof(rnum)) - != sizeof(rnum)) + != (ssize_t) (sizeof(rnum))) err(ECANCELED, "Could not read from /dev/urandom"); } @@ -534,7 +534,7 @@ write_gbe_part(int p) swap(p); /* swap bytes on big-endian host CPUs */ if (pwrite(fd, buf + (SIZE_4KB * p), - SIZE_4KB, p * partsize) != SIZE_4KB) { + SIZE_4KB, p * partsize) != (ssize_t) SIZE_4KB) { err(ECANCELED, "Can't write %d b to '%s' p%d", SIZE_4KB, fname, p); } -- cgit v1.2.1