lkml.org 
[lkml]   [2009]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2009-07-09 18:17    [W:0.230 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site