lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 09 Jul 2009 17:46:39 +0200
From:	Anders Larsen <al@...rsen.net>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ