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:	Tue, 3 Apr 2012 13:47:28 +0200
From:	Jesper Nilsson <jesper.nilsson@...s.com>
To:	Jiri Slaby <jslaby@...e.cz>
Cc:	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"alan@...ux.intel.com" <alan@...ux.intel.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"jirislaby@...il.com" <jirislaby@...il.com>,
	Mikael Starvik <starvik@...s.com>,
	linux-cris-kernel <linux-cris-kernel@...s.com>
Subject: Re: [PATCH 01/69] TTY: crisv10, remove unused tmp_buf

On Mon, Apr 02, 2012 at 01:53:45PM +0200, Jiri Slaby wrote:
> This used to be a helper buffer for generic_serial. generic_serial is
> gone, tmp_buf shall be removed.
> 
> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> Cc: Mikael Starvik <starvik@...s.com>

Looks good!

Acked-by: Jesper Nilsson <jesper.nilsson@...s.com>

> Cc: linux-cris-kernel@...s.com
> ---
>  drivers/tty/serial/crisv10.c |   27 +--------------------------
>  1 file changed, 1 insertion(+), 26 deletions(-)
> 
> diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
> index 5b07c0c..004ee2e 100644
> --- a/drivers/tty/serial/crisv10.c
> +++ b/drivers/tty/serial/crisv10.c
> @@ -952,19 +952,6 @@ static const struct control_pins e100_modem_pins[NR_PORTS] =
>  /* Input */
>  #define E100_DSR_GET(info) ((*e100_modem_pins[(info)->line].dsr_port) & e100_modem_pins[(info)->line].dsr_mask)
>  
> -
> -/*
> - * tmp_buf is used as a temporary buffer by serial_write.  We need to
> - * lock it in case the memcpy_fromfs blocks while swapping in a page,
> - * and some other program tries to do a serial write at the same time.
> - * Since the lock will only come under contention when the system is
> - * swapping and available memory is low, it makes sense to share one
> - * buffer across all the serial ports, since it significantly saves
> - * memory if large numbers of serial ports are open.
> - */
> -static unsigned char *tmp_buf;
> -static DEFINE_MUTEX(tmp_buf_mutex);
> -
>  /* Calculate the chartime depending on baudrate, numbor of bits etc. */
>  static void update_char_time(struct e100_serial * info)
>  {
> @@ -3150,7 +3137,7 @@ static int rs_raw_write(struct tty_struct *tty,
>  
>  	/* first some sanity checks */
>  
> -	if (!tty || !info->xmit.buf || !tmp_buf)
> +	if (!tty || !info->xmit.buf)
>  		return 0;
>  
>  #ifdef SERIAL_DEBUG_DATA
> @@ -4106,7 +4093,6 @@ rs_open(struct tty_struct *tty, struct file * filp)
>  {
>  	struct e100_serial	*info;
>  	int 			retval;
> -	unsigned long           page;
>  	int                     allocated_resources = 0;
>  
>  	info = rs_table + tty->index;
> @@ -4124,17 +4110,6 @@ rs_open(struct tty_struct *tty, struct file * filp)
>  
>  	tty->low_latency = !!(info->flags & ASYNC_LOW_LATENCY);
>  
> -	if (!tmp_buf) {
> -		page = get_zeroed_page(GFP_KERNEL);
> -		if (!page) {
> -			return -ENOMEM;
> -		}
> -		if (tmp_buf)
> -			free_page(page);
> -		else
> -			tmp_buf = (unsigned char *) page;
> -	}
> -
>  	/*
>  	 * If the port is in the middle of closing, bail out now
>  	 */
> -- 
> 1.7.9.2
> 
/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@...s.com
--
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