mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-29 21:47:05 +03:00
journal-verify: add comment and silence LGTM warning
This commit is contained in:
parent
cac4d95ec8
commit
0a587335d2
@ -60,10 +60,11 @@ static void draw_progress(uint64_t p, usec_t *last_usec) {
|
||||
}
|
||||
|
||||
static uint64_t scale_progress(uint64_t scale, uint64_t p, uint64_t m) {
|
||||
/* Calculates scale * p / m, but handles m == 0 safely, and saturates.
|
||||
* Currently all callers use m >= 1, but we keep the check to be defensive.
|
||||
*/
|
||||
|
||||
/* Calculates scale * p / m, but handles m == 0 safely, and saturates */
|
||||
|
||||
if (p >= m || m == 0)
|
||||
if (p >= m || m == 0) /* lgtm [cpp/constant-comparison] */
|
||||
return scale;
|
||||
|
||||
return scale * p / m;
|
||||
|
Loading…
x
Reference in New Issue
Block a user