@@ -683,22 +683,19 @@ static void cmis_show_dom_mod_lvl_flags(const struct cmis_memory_map *map)
* [1] CMIS Rev. 5, page 162, section 8.9.3, Table 8-77
* [1] CMIS Rev. 5, page 164, section 8.9.3, Table 8-78
*/
-static void cmis_show_dom_chan_lvl_flags_chan(const struct cmis_memory_map *map,
- int bank, int chan)
+static void cmis_show_dom_chan_lvl_flag(const struct cmis_memory_map *map,
+ int bank, int flag)
{
const __u8 *page_11h = map->upper_memory[bank][0x11];
int i;
- for (i = 0; module_aw_chan_flags[i].fmt_str; i++) {
+ for (i = 0; i < CMIS_CHANNELS_PER_BANK; i++) {
+ int chan = bank * CMIS_CHANNELS_PER_BANK + i;
char str[80];
- if (!(map->page_01h[module_aw_chan_flags[i].adver_offset] &
- module_aw_chan_flags[i].adver_value))
- continue;
-
- snprintf(str, 80, module_aw_chan_flags[i].fmt_str, chan + 1);
+ snprintf(str, 80, module_aw_chan_flags[flag].fmt_str, chan + 1);
printf("\t%-41s : %s\n", str,
- page_11h[module_aw_chan_flags[i].offset] & chan ?
+ page_11h[module_aw_chan_flags[flag].offset] & chan ?
"On" : "Off");
}
}
@@ -708,15 +705,17 @@ cmis_show_dom_chan_lvl_flags_bank(const struct cmis_memory_map *map,
int bank)
{
const __u8 *page_11h = map->upper_memory[bank][0x11];
- int i;
+ int flag;
if (!page_11h)
return;
- for (i = 0; i < CMIS_CHANNELS_PER_BANK; i++) {
- int chan = bank * CMIS_CHANNELS_PER_BANK + i;
+ for (flag = 0; module_aw_chan_flags[flag].fmt_str; flag++) {
+ if (!(map->page_01h[module_aw_chan_flags[flag].adver_offset] &
+ module_aw_chan_flags[flag].adver_value))
+ continue;
- cmis_show_dom_chan_lvl_flags_chan(map, bank, chan);
+ cmis_show_dom_chan_lvl_flag(map, bank, flag);
}
}