From f38e8fe9ee78565d125100dc34b5881717e0b66e Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 17 Jul 2016 09:08:04 +0900 Subject: [PATCH] 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 Signed-off-by: Dirk Hohndel --- src/suunto_eonsteel_parser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/suunto_eonsteel_parser.c b/src/suunto_eonsteel_parser.c index c11719a..b2fe5d8 100644 --- a/src/suunto_eonsteel_parser.c +++ b/src/suunto_eonsteel_parser.c @@ -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; }