From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: tty: add missing const to termios hw-change helper
Date: Mon, 21 May 2018 13:08:44 +0200 [thread overview]
Message-ID: <20180521110844.30728-1-johan@kernel.org> (raw)
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 *);
WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH] tty: add missing const to termios hw-change helper
Date: Mon, 21 May 2018 13:08:44 +0200 [thread overview]
Message-ID: <20180521110844.30728-1-johan@kernel.org> (raw)
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
next reply other threads:[~2018-05-21 11:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 11:08 Johan Hovold [this message]
2018-05-21 11:08 ` [PATCH] tty: add missing const to termios hw-change helper Johan Hovold
-- strict thread matches above, loose matches on Subject: below --
2018-05-21 16:41 Greg Kroah-Hartman
2018-05-21 16:41 ` [PATCH] " Greg Kroah-Hartman
2018-05-22 8:14 Johan Hovold
2018-05-22 8:14 ` [PATCH] " Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180521110844.30728-1-johan@kernel.org \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.