From 8136c2d78b5769c4dfca0f6d68b1a9ccb95f698e Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 16 Nov 2017 17:35:03 -0800 Subject: Clean up confusing code in setup_gas_sensor_pressure() The "prev" cylinder can never be negative since commit 56c206d19fba ("For more manual gas pressure details"), so remove stale code that checks for a case that cannot happen any more. Signed-off-by: Linus Torvalds --- core/profile.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/profile.c b/core/profile.c index 50e906a09..4aae8b89e 100644 --- a/core/profile.c +++ b/core/profile.c @@ -835,8 +835,7 @@ static void setup_gas_sensor_pressure(struct dive *dive, struct divecomputer *dc if (cyl < 0) continue; - if (prev >= 0) - last[prev] = sec; + last[prev] = sec; prev = cyl; last[cyl] = sec; @@ -846,8 +845,7 @@ static void setup_gas_sensor_pressure(struct dive *dive, struct divecomputer *dc seen[cyl] = 1; } } - if (prev >= 0) - last[prev] = INT_MAX; + last[prev] = INT_MAX; for (i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cyl = dive->cylinder + i; -- cgit v1.2.3-70-g09d2