* Pekka Enberg <[email protected]> wrote:
> static bool kbd_in(struct ioport *ioport, struct kvm *kvm, u16 port, void
> *data, int size, u32 count)
> {
> - u32 result;
> -
> - if (port == I8042_COMMAND_REG) {
> - result = kbd_read_status();
> - ioport__write8(data, (char)result);
> - } else {
> - result = kbd_read_data();
> - ioport__write32(data, result);
> + switch (port) {
> + case I8042_COMMAND_REG: {
> + u8 value = kbd_read_status();
> + ioport__write8(data, value);
> + break;
> + }
> + case I8042_DATA_REG: {
> + u32 value = kbd_read_data();
> + ioport__write32(data, value);
> + break;
> }
> + default:
> + break;
should we BUG_ON() [or WARN_ON()] in that 'default' case?
> + default:
> + break;
ditto. This could have caught the bug straight away, right?
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html