Re: [PATCH 0/3] Fix sysrq caused USB performance regressions andleak

From: Anders Larsen
Date: Thu Jul 09 2009 - 12:14:45 EST


Apart from very similar code being added differently,
here this way around...

> drivers/usb/serial/generic.c | 15 +++++++++++----
>
> + if (!port->console || !port->sysrq)
> + tty_insert_flip_string(tty, ch, urb->actual_length);
> + else {
> + /* Push data to tty */
> + for (i = 0; i < urb->actual_length; i++, ch++) {
> + if (!usb_serial_handle_sysrq_char(port, *ch))
> + tty_insert_flip_char(tty, *ch, TTY_NORMAL);
> + }

...and there the other way around,

> drivers/usb/serial/pl2303.c | 58 ++++++++++++++++++++++++-------------------
>
> + if (port->console && port->sysrq) {
> + int i;
> + for (i = 0; i < urb->actual_length; ++i)
> + if (!usb_serial_handle_sysrq_char(tty, port, data[i]))
> + tty_insert_flip_char(tty, data[i], tty_flag);
> + } else
> + tty_insert_flip_string(tty, data, urb->actual_length);

shouldn't it be
+ if (likely(!port->console || !port->sysrq))
respectively
+ if (unlikely(port->console && port->sysrq)) {

at least for clarity?

Cheers
Anders
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/