CMIS encodes different channel-level flags (e.g., "Laser bias current high alarm") in different bytes where each bit corresponds to the value of the flag in a different channel. Since CMIS supports more than 8 channels, these flags can be banked (e.g., channels 1-8 in bank 0, channels 9-16 in bank 1 etc.). The code is currently applying the wrong bit mask (the channel number itself) when extracting the per-channel flag. Fix the calculation of the bit mask so that the channel offset (0-7) in the current bank determines the number of bits that are shifted. Fixes: 340d88ee1289 ("cmis: Parse and print diagnostic information") Reviewed-by: Danielle Ratson Signed-off-by: Ido Schimmel --- cmis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmis.c b/cmis.c index a4bf455c2a77..16f168a3b1af 100644 --- a/cmis.c +++ b/cmis.c @@ -766,7 +766,7 @@ static void cmis_show_dom_chan_lvl_flag(const struct cmis_memory_map *map, char str[80]; bool value; - value = page_11h[module_aw_chan_flags[flag].offset] & chan; + value = page_11h[module_aw_chan_flags[flag].offset] & (1 << i); if (is_json_context()) { print_bool(PRINT_JSON, NULL, NULL, value); } else { -- 2.55.0