mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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:
@@ -2128,8 +2128,6 @@ dsl_livelist_should_disable(dsl_dataset_t *ds)
|
||||
|
||||
used = dsl_dir_get_usedds(ds->ds_dir);
|
||||
referenced = dsl_get_referenced(ds);
|
||||
ASSERT3U(referenced, >=, 0);
|
||||
ASSERT3U(used, >=, 0);
|
||||
if (referenced == 0)
|
||||
return (B_FALSE);
|
||||
percent_shared = (100 * (referenced - used)) / referenced;
|
||||
|
||||
Reference in New Issue
Block a user