set_2regs() is a macro. Macro have side effects.
Before the change, assuming speed != XFER_UDMA_2
if (speed == XFER_UDMA_2) {
OUT_BYTE((thold + adj), indexreg); <- not executed
OUT_BYTE((IN_BYTE(datareg) & 0x7f), datareg); <- not executed
}
-> the block isn't executed
After the change, the code is:
if (speed == XFER_UDMA_2)
OUT_BYTE((thold + adj), indexreg); <- not executed
OUT_BYTE((IN_BYTE(datareg) & 0x7f), datareg); <- executed, damn it !
-> only the first statement of the macro is executed.
Put a pair of {} after the "if", a "do {...} while (0)" in the macro
declaration. Please, please, think about it a few minutes.
-- Ueimor - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/