mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: simplify stats nr_areas calculation (Coverity)
Remove an unneccessary conditional operator and simplify the logic in _nr_areas: libdm/libdm-stats.c: 501 in _nr_areas() - Control flow issues (DEADCODE)
This commit is contained in:
parent
ec87e88c52
commit
856f9cced8
@ -503,8 +503,7 @@ static uint64_t _nr_areas(uint64_t len, uint64_t step)
|
||||
* treat the entire region as a single area. Any partial area at the
|
||||
* end of the region is treated as an additional complete area.
|
||||
*/
|
||||
return (len && step)
|
||||
? (len / (step ? step : len)) + !!(len % step) : 0;
|
||||
return (len / (step ? : len)) + !!(len % step);
|
||||
}
|
||||
|
||||
static uint64_t _nr_areas_region(struct dm_stats_region *region)
|
||||
|
Loading…
Reference in New Issue
Block a user