]> git.baikalelectronics.ru Git - kernel.git/commit
tty: constify return type of tty_name
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Tue, 31 Mar 2015 13:55:57 +0000 (15:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:26:57 +0000 (22:26 +0200)
commit5b39071d44ed5d389e208dc4d927b6714ff2031c
treec959dc2546bdaf01d8c29cd49530561049f11b1e
parent6067db94ccba294f2c5b44c68420d572aa84d1df
tty: constify return type of tty_name

All users of tty_name pass the result directly to a printf-like
function. This means we can actually let tty_name return the literal
"NULL tty" or tty->name directly, avoiding the strcpy and a lot of
medium-sized stack buffers. In preparation for that, make the return
type const char*.

While at it, we can also constify the tty parameter.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c
include/linux/tty.h