Messages in this thread | | | Date | Thu, 09 Jul 2009 17:46:39 +0200 | From | Anders Larsen <> | Subject | Re: [PATCH 0/3] Fix sysrq caused USB performance regressions and leak |
| |
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
| |