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:
@@ -527,7 +527,7 @@ zfs_acl_valid_ace_type(uint_t type, uint_t flags)
|
||||
entry_type == ACE_EVERYONE || entry_type == 0 ||
|
||||
entry_type == ACE_IDENTIFIER_GROUP);
|
||||
default:
|
||||
if (type >= MIN_ACE_TYPE && type <= MAX_ACE_TYPE)
|
||||
if (type <= MAX_ACE_TYPE)
|
||||
return (B_TRUE);
|
||||
}
|
||||
return (B_FALSE);
|
||||
|
||||
@@ -525,7 +525,7 @@ zfs_acl_valid_ace_type(uint_t type, uint_t flags)
|
||||
entry_type == ACE_EVERYONE || entry_type == 0 ||
|
||||
entry_type == ACE_IDENTIFIER_GROUP);
|
||||
default:
|
||||
if (type >= MIN_ACE_TYPE && type <= MAX_ACE_TYPE)
|
||||
if (type <= MAX_ACE_TYPE)
|
||||
return (B_TRUE);
|
||||
}
|
||||
return (B_FALSE);
|
||||
|
||||
@@ -1433,7 +1433,7 @@ zvol_os_create_minor(const char *name)
|
||||
* Prefetching the blocks commonly scanned by blkid(8) will speed
|
||||
* up this process.
|
||||
*/
|
||||
len = MIN(MAX(zvol_prefetch_bytes, 0), SPA_MAXBLOCKSIZE);
|
||||
len = MIN(zvol_prefetch_bytes, SPA_MAXBLOCKSIZE);
|
||||
if (len > 0) {
|
||||
dmu_prefetch(os, ZVOL_OBJ, 0, 0, len, ZIO_PRIORITY_SYNC_READ);
|
||||
dmu_prefetch(os, ZVOL_OBJ, 0, volsize - len, len,
|
||||
|
||||
Reference in New Issue
Block a user