EON Steel: mark tank cache initialized when filling it in

The previous commit fixed the cache initialization testing, and
uncovered the fact that the tank size cache initialization didn't set
the initialized bit correctly.  That oversight had been hidden by the
fact that we then tested the bit wrongly, so not setting it right didn't
use to matter as long as there were other higher cache bits that were
set.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2016-07-17 09:08:04 +09:00 committed by Dirk Hohndel
parent 0aeae321dc
commit f38e8fe9ee

View File

@ -1074,6 +1074,7 @@ static int add_gas_type(suunto_eonsteel_parser_t *eon, const struct type_desc *d
if (eon->cache.ngases < MAXGASES)
eon->cache.ngases++;
eon->cache.initialized |= 1 << DC_FIELD_GASMIX_COUNT;
eon->cache.initialized |= 1 << DC_FIELD_TANK_COUNT;
return 0;
}
@ -1104,6 +1105,7 @@ static int add_gas_size(suunto_eonsteel_parser_t *eon, float l)
int idx = eon->cache.ngases-1;
if (idx >= 0)
eon->cache.tanksize[idx] = l;
eon->cache.initialized |= 1 << DC_FIELD_TANK;
return 0;
}