Cleanup: Remove ineffective unsigned comparisons against 0

Coverity found a number of places where we either do MAX(unsigned, 0) or
do assertions that a unsigned variable is >= 0. These do nothing, so
let us drop them all.

It also found a spot where we do `if (unsigned >= 0 && ...)`. Let us
also drop the unsigned >= 0 check.

Reviewed-by: Neal Gompa <ngompa@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13871
This commit is contained in:
Richard Yao
2022-09-26 20:02:38 -04:00
committed by GitHub
parent 52afc3443d
commit 8ef15f9322
8 changed files with 5 additions and 9 deletions
-1
View File
@@ -155,7 +155,6 @@ blake3_impl_setid(uint32_t id)
atomic_swap_32(&blake3_impl_chosen, IMPL_CYCLE);
break;
default:
ASSERT3U(id, >=, 0);
ASSERT3U(id, <, blake3_supp_impls_cnt);
atomic_swap_32(&blake3_impl_chosen, id);
break;