Skip to contentSkip to conversation

tty: add missing const to termios hw-change helper

PATCH In review Johan Hovold 2 participants 3 messages May 21, 2018 – May 22, 2018

Subsystems (3)
lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

PATCH 1/1 tty: add missing const to termios hw-change helper

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 <[email protected]>
Cc Jiri Slaby <[email protected]>

---

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(-)
drivers/tty/tty_ioctl.c +1 -1
index d9b561d89432..d99fec44036c 100644
@@ -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;
drivers/usb/serial/pl2303.c +1 -1
index ac231cdf48a6..5d1a1931967e 100644
@@ -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;
 
include/linux/tty.h +1 -1
index 1dd587ba6d88..955cd0c93d84 100644
@@ -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 *);
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · 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 <[email protected]>
Cc Jiri Slaby <[email protected]>
Quoted 7 lines

---

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.

Your tree is fine:

---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#2 lore raw
Quoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · 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 <[email protected]>
Cc Jiri Slaby <[email protected]>

---

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

Quoted 6 lines
Quoted 2 lines

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.

Your tree is fine:

I made this patch a prerequisite of the pl2303 change so that I could use const there from the start instead (i.e. I dropped the pl2303 chunk from this one).

Now applied.

Thanks,
Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html