1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

dmstats: simplify nr_areas calculation (CWE-561)

Eliminate dead conditional (step cannot be zero).

Fixes commit 988ca74.
This commit is contained in:
Bryn M. Reeves 2016-07-04 19:25:40 +01:00
parent 21b946dfb7
commit 1faa208067

View File

@ -4745,7 +4745,7 @@ static uint64_t _nr_areas_from_step(uint64_t len, int64_t step)
return (uint64_t)(-step);
/* --areasize - cast step to unsigned as it cannot be -ve here. */
return (len / (step ? : len)) + !!(len % (uint64_t) step);
return (len / step) + !!(len % (uint64_t) step);
}
/*