From: Johan Hovold Date: Mon, 21 May 2018 11:08:44 +0000 (+0200) Subject: tty: add missing const to termios hw-change helper X-Git-Tag: v5.15~8714^2~40^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b0c6b38c4f9f9736ccd41363b3cfd7143e1f823;p=platform%2Fkernel%2Flinux-starfive.git tty: add missing const to termios hw-change helper Add missing const qualifiers to the parameters of the termios hw-change helper, which is used by a few USB serial drivers. This specifically allows the pl2303 driver to use const arguments in one of its helper as well. Cc: Jiri Slaby Acked-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold --- diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index d9b561d..d99fec4 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c @@ -290,7 +290,7 @@ EXPORT_SYMBOL(tty_termios_copy_hw); * between the two termios structures, or a speed change is needed. */ -int tty_termios_hw_change(struct ktermios *a, struct ktermios *b) +int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b) { if (a->c_ispeed != b->c_ispeed || a->c_ospeed != b->c_ospeed) return 1; diff --git a/include/linux/tty.h b/include/linux/tty.h index 1dd587ba..955cd0c 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -527,7 +527,7 @@ static inline speed_t tty_get_baud_rate(struct tty_struct *tty) } extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); -extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); +extern int tty_termios_hw_change(const struct ktermios *a, const struct ktermios *b); extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *);