public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tty: add missing const to termios hw-change helper
@ 2018-05-21 11:08 Johan Hovold
  2018-05-21 16:41 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Hovold @ 2018-05-21 11:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jiri Slaby, linux-kernel, linux-usb, Johan Hovold

Add missing const qualifiers to the termios hw-change helper parameters,
which is used by few USB serial drivers. This specifically allows the
pl2303 driver to use const arguments in one of its helper as well.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---

Greg, are you fine with me taking this one through my tree, or do prefer
I split out the pl2303 bits?

Note that this helper is only used by a few USB serial drivers and that
the pl2303 bits depend on a new patch targeted for -next.

Thanks,
Johan


 drivers/tty/tty_ioctl.c     | 2 +-
 drivers/usb/serial/pl2303.c | 2 +-
 include/linux/tty.h         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index d9b561d89432..d99fec44036c 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/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index ac231cdf48a6..5d1a1931967e 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -533,7 +533,7 @@ static int pl2303_set_line_request(struct usb_serial_port *port,
 	return 0;
 }
 
-static bool pl2303_termios_change(struct ktermios *a, struct ktermios *b)
+static bool pl2303_termios_change(const struct ktermios *a, const struct ktermios *b)
 {
 	bool ixon_change;
 
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 1dd587ba6d88..955cd0c93d84 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 *);
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-22  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-21 11:08 [PATCH] tty: add missing const to termios hw-change helper Johan Hovold
2018-05-21 16:41 ` Greg Kroah-Hartman
2018-05-22  8:14   ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox