diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-06 13:36:42 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-06 13:37:38 +0000 |
| commit | d89d14e911a8bfc1a4562e8d799370448e793990 (patch) | |
| tree | 32aa7ab767d66d91c4b3f84e19f027665dba7093 | |
| parent | f96a119523fbe18e8221aaadd247dfce48bd884f (diff) | |
util/nvmutil: remove pointless check
the input is already size_t, which is unsigned
there's no point in checking for negative
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 13715611..9b0ac3f0 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -651,8 +651,6 @@ get_word_pos(size_t pos16, int p) static void check_bound(size_t c, int p) { - ssize_t a = (ssize_t) c; - /* * NVM_SIZE assumed as the limit, because the * current design assumes that we will only @@ -669,8 +667,8 @@ check_bound(size_t c, int p) if ((p != 0) && (p != 1)) err(EINVAL, "check_bound: invalid partnum %d", p); - if ((a < 0) || (a >= (NVM_SIZE >> 1))) - err(EINVAL, "check_bound: out of bounds %zd", a); + if (c >= (NVM_SIZE >> 1)) + err(EINVAL, "check_bound: out of bounds %zu", c); } static void |
