From: Jason Wessel Date: Mon, 13 Oct 2008 09:45:36 +0000 (+0100) Subject: tty: tty_io.c shadows sparse fix X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=402fda9201ac619ea1f120996b1a142c57aeeb6b;p=openwrt%2Fstaging%2Fblogic.git tty: tty_io.c shadows sparse fix drivers/char/tty_io.c:1413:17: warning: symbol 'buf' shadows an earlier one drivers/char/tty_io.c:1379:20: originally declared here Signed-off-by: Jason Wessel Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 502cad68f83c..7053d6333692 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1026,19 +1026,19 @@ static inline ssize_t do_tty_write( /* write_buf/write_cnt is protected by the atomic_write_lock mutex */ if (tty->write_cnt < chunk) { - unsigned char *buf; + unsigned char *buf_chunk; if (chunk < 1024) chunk = 1024; - buf = kmalloc(chunk, GFP_KERNEL); - if (!buf) { + buf_chunk = kmalloc(chunk, GFP_KERNEL); + if (!buf_chunk) { ret = -ENOMEM; goto out; } kfree(tty->write_buf); tty->write_cnt = chunk; - tty->write_buf = buf; + tty->write_buf = buf_chunk; } /* Do the write .. */