mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-20 05:36:23 +02:00
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>
This commit is contained in:
@@ -651,8 +651,6 @@ get_word_pos(size_t pos16, int p)
|
|||||||
static void
|
static void
|
||||||
check_bound(size_t c, int p)
|
check_bound(size_t c, int p)
|
||||||
{
|
{
|
||||||
ssize_t a = (ssize_t) c;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NVM_SIZE assumed as the limit, because the
|
* NVM_SIZE assumed as the limit, because the
|
||||||
* current design assumes that we will only
|
* current design assumes that we will only
|
||||||
@@ -669,8 +667,8 @@ check_bound(size_t c, int p)
|
|||||||
|
|
||||||
if ((p != 0) && (p != 1))
|
if ((p != 0) && (p != 1))
|
||||||
err(EINVAL, "check_bound: invalid partnum %d", p);
|
err(EINVAL, "check_bound: invalid partnum %d", p);
|
||||||
if ((a < 0) || (a >= (NVM_SIZE >> 1)))
|
if (c >= (NVM_SIZE >> 1))
|
||||||
err(EINVAL, "check_bound: out of bounds %zd", a);
|
err(EINVAL, "check_bound: out of bounds %zu", c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user