]> git.baikalelectronics.ru Git - uboot.git/commit
sandbox: Fix comparison of unsigned enum expression warning
authorTom Rini <trini@konsulko.com>
Sun, 14 May 2017 00:11:30 +0000 (20:11 -0400)
committerSimon Glass <sjg@chromium.org>
Fri, 9 Jun 2017 02:21:59 +0000 (20:21 -0600)
commitb010deb3eb4d0de1e26e4d6cf7a8b2c96bd7bfc5
tree5ce8494175b9c0a89afbf690667a2f3398d1b453
parentaed0aeb733d814a6f792e9976066bd4d72ab9cff
sandbox: Fix comparison of unsigned enum expression warning

In os_dirent_get_typename() we are checking that type falls within the
known values of the enum os_dirent_t.  With clang-3.8 testing this value
as being >= 0 results in a warning as it will always be true.  This
assumes of course that we are only given valid data.  Given that we want
to sanity check the input, we change this to check that it falls within
the range of the first to the last entry in the given enum.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/sandbox/cpu/os.c