Skip to content
Snippets Groups Projects
Select Git revision
0 results

os.c

Blame
  • Forked from Reform / reform-boundary-uboot
    Source project has a limited visibility.
    • Tom Rini's avatar
      e2bc87d4
      sandbox: Fix comparison of unsigned enum expression warning · e2bc87d4
      Tom Rini authored
      
      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: default avatarTom Rini <trini@konsulko.com>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
      e2bc87d4
      History
      sandbox: Fix comparison of unsigned enum expression warning
      Tom Rini authored
      
      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: default avatarTom Rini <trini@konsulko.com>
      Reviewed-by: default avatarSimon Glass <sjg@chromium.org>