Using 'continue' in a loop is fatal if the last statement in the loop
increments the loop index.
Modify the loop to always increment the loop index (list pointer in
this case).
while (*mpp_list) {
- unsigned int num = MPP_NUM(*mpp_list);
- unsigned int sel = MPP_SEL(*mpp_list);
+ u32 mpp = *mpp_list++;
+ unsigned int num = MPP_NUM(mpp);
+ unsigned int sel = MPP_SEL(mpp);
unsigned int sel_save;
int shift;
"number (%u)\n", num);
continue;
}
- if (!(*mpp_list & variant_mask)) {
+ if (!(mpp & variant_mask)) {
debug("kirkwood_mpp_conf: requested MPP%u config "
"unavailable on this hardware\n", num);
continue;
mpp_ctrl[num / 8] &= ~(0xf << shift);
mpp_ctrl[num / 8] |= sel << shift;
-
- mpp_list++;
}
debug(" final MPP regs:");