mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
tty: Make ->set_termios() old ktermios const
There should be no reason to adjust old ktermios which is going to get discarded anyway. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20220816115739.10928-9-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f6d47fe592
commit
a8c11c1520
18 changed files with 39 additions and 29 deletions
|
@ -2274,7 +2274,8 @@ static int mgslpc_ioctl(struct tty_struct *tty,
|
||||||
* tty pointer to tty structure
|
* tty pointer to tty structure
|
||||||
* termios pointer to buffer to hold returned old termios
|
* termios pointer to buffer to hold returned old termios
|
||||||
*/
|
*/
|
||||||
static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
|
static void mgslpc_set_termios(struct tty_struct *tty,
|
||||||
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
|
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
|
@ -497,7 +497,7 @@ static unsigned int ipoctal_chars_in_buffer(struct tty_struct *tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ipoctal_set_termios(struct tty_struct *tty,
|
static void ipoctal_set_termios(struct tty_struct *tty,
|
||||||
struct ktermios *old_termios)
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
unsigned int cflag;
|
unsigned int cflag;
|
||||||
unsigned char mr1 = 0;
|
unsigned char mr1 = 0;
|
||||||
|
|
|
@ -246,7 +246,7 @@ static inline void sdio_uart_update_mctrl(struct sdio_uart_port *port,
|
||||||
|
|
||||||
static void sdio_uart_change_speed(struct sdio_uart_port *port,
|
static void sdio_uart_change_speed(struct sdio_uart_port *port,
|
||||||
struct ktermios *termios,
|
struct ktermios *termios,
|
||||||
struct ktermios *old)
|
const struct ktermios *old)
|
||||||
{
|
{
|
||||||
unsigned char cval, fcr = 0;
|
unsigned char cval, fcr = 0;
|
||||||
unsigned int baud, quot;
|
unsigned int baud, quot;
|
||||||
|
@ -859,7 +859,7 @@ static void sdio_uart_unthrottle(struct tty_struct *tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sdio_uart_set_termios(struct tty_struct *tty,
|
static void sdio_uart_set_termios(struct tty_struct *tty,
|
||||||
struct ktermios *old_termios)
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
struct sdio_uart_port *port = tty->driver_data;
|
struct sdio_uart_port *port = tty->driver_data;
|
||||||
unsigned int cflag = tty->termios.c_cflag;
|
unsigned int cflag = tty->termios.c_cflag;
|
||||||
|
|
|
@ -1380,7 +1380,8 @@ static void hso_serial_cleanup(struct tty_struct *tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setup the term */
|
/* setup the term */
|
||||||
static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
|
static void hso_serial_set_termios(struct tty_struct *tty,
|
||||||
|
const struct ktermios *old)
|
||||||
{
|
{
|
||||||
struct hso_serial *serial = tty->driver_data;
|
struct hso_serial *serial = tty->driver_data;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
|
@ -1760,7 +1760,7 @@ tty3270_flush_chars(struct tty_struct *tty)
|
||||||
* Check for visible/invisible input switches
|
* Check for visible/invisible input switches
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
tty3270_set_termios(struct tty_struct *tty, struct ktermios *old)
|
tty3270_set_termios(struct tty_struct *tty, const struct ktermios *old)
|
||||||
{
|
{
|
||||||
struct tty3270 *tp;
|
struct tty3270 *tp;
|
||||||
int new;
|
int new;
|
||||||
|
|
|
@ -1267,7 +1267,8 @@ static int fwtty_ioctl(struct tty_struct *tty, unsigned int cmd,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fwtty_set_termios(struct tty_struct *tty, struct ktermios *old)
|
static void fwtty_set_termios(struct tty_struct *tty,
|
||||||
|
const struct ktermios *old)
|
||||||
{
|
{
|
||||||
struct fwtty_port *port = tty->driver_data;
|
struct fwtty_port *port = tty->driver_data;
|
||||||
unsigned int baud;
|
unsigned int baud;
|
||||||
|
|
|
@ -480,7 +480,7 @@ static int gb_tty_break_ctl(struct tty_struct *tty, int state)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gb_tty_set_termios(struct tty_struct *tty,
|
static void gb_tty_set_termios(struct tty_struct *tty,
|
||||||
struct ktermios *termios_old)
|
const struct ktermios *termios_old)
|
||||||
{
|
{
|
||||||
struct gb_uart_set_line_coding_request newline;
|
struct gb_uart_set_line_coding_request newline;
|
||||||
struct gb_tty *gb_tty = tty->driver_data;
|
struct gb_tty *gb_tty = tty->driver_data;
|
||||||
|
|
|
@ -94,7 +94,7 @@ static struct tty_driver *serial_driver;
|
||||||
static unsigned char current_ctl_bits;
|
static unsigned char current_ctl_bits;
|
||||||
|
|
||||||
static void change_speed(struct tty_struct *tty, struct serial_state *info,
|
static void change_speed(struct tty_struct *tty, struct serial_state *info,
|
||||||
struct ktermios *old);
|
const struct ktermios *old);
|
||||||
static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
|
static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
|
||||||
|
|
||||||
|
|
||||||
|
@ -566,7 +566,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info)
|
||||||
* the specified baud rate for a serial port.
|
* the specified baud rate for a serial port.
|
||||||
*/
|
*/
|
||||||
static void change_speed(struct tty_struct *tty, struct serial_state *info,
|
static void change_speed(struct tty_struct *tty, struct serial_state *info,
|
||||||
struct ktermios *old_termios)
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
struct tty_port *port = &info->tport;
|
struct tty_port *port = &info->tport;
|
||||||
int quot = 0, baud_base, baud;
|
int quot = 0, baud_base, baud;
|
||||||
|
@ -1169,7 +1169,7 @@ static int rs_ioctl(struct tty_struct *tty,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
|
static void rs_set_termios(struct tty_struct *tty, const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
struct serial_state *info = tty->driver_data;
|
struct serial_state *info = tty->driver_data;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
|
@ -491,7 +491,7 @@ static int moxa_write(struct tty_struct *, const unsigned char *, int);
|
||||||
static unsigned int moxa_write_room(struct tty_struct *);
|
static unsigned int moxa_write_room(struct tty_struct *);
|
||||||
static void moxa_flush_buffer(struct tty_struct *);
|
static void moxa_flush_buffer(struct tty_struct *);
|
||||||
static unsigned int moxa_chars_in_buffer(struct tty_struct *);
|
static unsigned int moxa_chars_in_buffer(struct tty_struct *);
|
||||||
static void moxa_set_termios(struct tty_struct *, struct ktermios *);
|
static void moxa_set_termios(struct tty_struct *, const struct ktermios *);
|
||||||
static void moxa_stop(struct tty_struct *);
|
static void moxa_stop(struct tty_struct *);
|
||||||
static void moxa_start(struct tty_struct *);
|
static void moxa_start(struct tty_struct *);
|
||||||
static void moxa_hangup(struct tty_struct *);
|
static void moxa_hangup(struct tty_struct *);
|
||||||
|
@ -499,7 +499,7 @@ static int moxa_tiocmget(struct tty_struct *tty);
|
||||||
static int moxa_tiocmset(struct tty_struct *tty,
|
static int moxa_tiocmset(struct tty_struct *tty,
|
||||||
unsigned int set, unsigned int clear);
|
unsigned int set, unsigned int clear);
|
||||||
static void moxa_poll(struct timer_list *);
|
static void moxa_poll(struct timer_list *);
|
||||||
static void moxa_set_tty_param(struct tty_struct *, struct ktermios *);
|
static void moxa_set_tty_param(struct tty_struct *, const struct ktermios *);
|
||||||
static void moxa_shutdown(struct tty_port *);
|
static void moxa_shutdown(struct tty_port *);
|
||||||
static int moxa_carrier_raised(struct tty_port *);
|
static int moxa_carrier_raised(struct tty_port *);
|
||||||
static void moxa_dtr_rts(struct tty_port *, int);
|
static void moxa_dtr_rts(struct tty_port *, int);
|
||||||
|
@ -1602,7 +1602,7 @@ static int moxa_tiocmset(struct tty_struct *tty,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void moxa_set_termios(struct tty_struct *tty,
|
static void moxa_set_termios(struct tty_struct *tty,
|
||||||
struct ktermios *old_termios)
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
struct moxa_port *ch = tty->driver_data;
|
struct moxa_port *ch = tty->driver_data;
|
||||||
|
|
||||||
|
@ -1761,7 +1761,8 @@ static void moxa_poll(struct timer_list *unused)
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
static void moxa_set_tty_param(struct tty_struct *tty, struct ktermios *old_termios)
|
static void moxa_set_tty_param(struct tty_struct *tty,
|
||||||
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
register struct ktermios *ts = &tty->termios;
|
register struct ktermios *ts = &tty->termios;
|
||||||
struct moxa_port *ch = tty->driver_data;
|
struct moxa_port *ch = tty->driver_data;
|
||||||
|
|
|
@ -571,7 +571,8 @@ static void mxser_handle_cts(struct tty_struct *tty, struct mxser_port *info,
|
||||||
* This routine is called to set the UART divisor registers to match
|
* This routine is called to set the UART divisor registers to match
|
||||||
* the specified baud rate for a serial port.
|
* the specified baud rate for a serial port.
|
||||||
*/
|
*/
|
||||||
static void mxser_change_speed(struct tty_struct *tty, struct ktermios *old_termios)
|
static void mxser_change_speed(struct tty_struct *tty,
|
||||||
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
struct mxser_port *info = tty->driver_data;
|
struct mxser_port *info = tty->driver_data;
|
||||||
unsigned cflag, cval;
|
unsigned cflag, cval;
|
||||||
|
@ -1348,7 +1349,8 @@ static void mxser_start(struct tty_struct *tty)
|
||||||
spin_unlock_irqrestore(&info->slock, flags);
|
spin_unlock_irqrestore(&info->slock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
|
static void mxser_set_termios(struct tty_struct *tty,
|
||||||
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
struct mxser_port *info = tty->driver_data;
|
struct mxser_port *info = tty->driver_data;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
|
@ -3647,7 +3647,8 @@ static int gsmtty_ioctl(struct tty_struct *tty,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gsmtty_set_termios(struct tty_struct *tty, struct ktermios *old)
|
static void gsmtty_set_termios(struct tty_struct *tty,
|
||||||
|
const struct ktermios *old)
|
||||||
{
|
{
|
||||||
struct gsm_dlci *dlci = tty->driver_data;
|
struct gsm_dlci *dlci = tty->driver_data;
|
||||||
if (dlci->state == DLCI_CLOSED)
|
if (dlci->state == DLCI_CLOSED)
|
||||||
|
|
|
@ -240,7 +240,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pty_set_termios(struct tty_struct *tty,
|
static void pty_set_termios(struct tty_struct *tty,
|
||||||
struct ktermios *old_termios)
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
/* See if packet mode change of state. */
|
/* See if packet mode change of state. */
|
||||||
if (tty->link && tty->link->ctrl.packet) {
|
if (tty->link && tty->link->ctrl.packet) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ static struct lock_class_key port_lock_key;
|
||||||
#define RS485_MAX_RTS_DELAY 100 /* msecs */
|
#define RS485_MAX_RTS_DELAY 100 /* msecs */
|
||||||
|
|
||||||
static void uart_change_speed(struct tty_struct *tty, struct uart_state *state,
|
static void uart_change_speed(struct tty_struct *tty, struct uart_state *state,
|
||||||
struct ktermios *old_termios);
|
const struct ktermios *old_termios);
|
||||||
static void uart_wait_until_sent(struct tty_struct *tty, int timeout);
|
static void uart_wait_until_sent(struct tty_struct *tty, int timeout);
|
||||||
static void uart_change_pm(struct uart_state *state,
|
static void uart_change_pm(struct uart_state *state,
|
||||||
enum uart_pm_state pm_state);
|
enum uart_pm_state pm_state);
|
||||||
|
@ -492,7 +492,7 @@ EXPORT_SYMBOL(uart_get_divisor);
|
||||||
|
|
||||||
/* Caller holds port mutex */
|
/* Caller holds port mutex */
|
||||||
static void uart_change_speed(struct tty_struct *tty, struct uart_state *state,
|
static void uart_change_speed(struct tty_struct *tty, struct uart_state *state,
|
||||||
struct ktermios *old_termios)
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
struct uart_port *uport = uart_port_check(state);
|
struct uart_port *uport = uart_port_check(state);
|
||||||
struct ktermios *termios;
|
struct ktermios *termios;
|
||||||
|
@ -1619,7 +1619,7 @@ static void uart_set_ldisc(struct tty_struct *tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uart_set_termios(struct tty_struct *tty,
|
static void uart_set_termios(struct tty_struct *tty,
|
||||||
struct ktermios *old_termios)
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
struct uart_state *state = tty->driver_data;
|
struct uart_state *state = tty->driver_data;
|
||||||
struct uart_port *uport;
|
struct uart_port *uport;
|
||||||
|
|
|
@ -707,7 +707,8 @@ static void hangup(struct tty_struct *tty)
|
||||||
wake_up_interruptible(&info->port.open_wait);
|
wake_up_interruptible(&info->port.open_wait);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_termios(struct tty_struct *tty, struct ktermios *old_termios)
|
static void set_termios(struct tty_struct *tty,
|
||||||
|
const struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
struct slgt_info *info = tty->driver_data;
|
struct slgt_info *info = tty->driver_data;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
|
@ -51,7 +51,7 @@ static DEFINE_IDR(acm_minors);
|
||||||
static DEFINE_MUTEX(acm_minors_lock);
|
static DEFINE_MUTEX(acm_minors_lock);
|
||||||
|
|
||||||
static void acm_tty_set_termios(struct tty_struct *tty,
|
static void acm_tty_set_termios(struct tty_struct *tty,
|
||||||
struct ktermios *termios_old);
|
const struct ktermios *termios_old);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* acm_minors accessors
|
* acm_minors accessors
|
||||||
|
@ -1049,7 +1049,7 @@ static int acm_tty_ioctl(struct tty_struct *tty,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void acm_tty_set_termios(struct tty_struct *tty,
|
static void acm_tty_set_termios(struct tty_struct *tty,
|
||||||
struct ktermios *termios_old)
|
const struct ktermios *termios_old)
|
||||||
{
|
{
|
||||||
struct acm *acm = tty->driver_data;
|
struct acm *acm = tty->driver_data;
|
||||||
struct ktermios *termios = &tty->termios;
|
struct ktermios *termios = &tty->termios;
|
||||||
|
|
|
@ -519,7 +519,8 @@ static int serial_ioctl(struct tty_struct *tty,
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void serial_set_termios(struct tty_struct *tty, struct ktermios *old)
|
static void serial_set_termios(struct tty_struct *tty,
|
||||||
|
const struct ktermios *old)
|
||||||
{
|
{
|
||||||
struct usb_serial_port *port = tty->driver_data;
|
struct usb_serial_port *port = tty->driver_data;
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,7 @@ struct serial_struct;
|
||||||
*
|
*
|
||||||
* Optional.
|
* Optional.
|
||||||
*
|
*
|
||||||
* @set_termios: ``void ()(struct tty_struct *tty, struct ktermios *old)``
|
* @set_termios: ``void ()(struct tty_struct *tty, const struct ktermios *old)``
|
||||||
*
|
*
|
||||||
* This routine allows the @tty driver to be notified when device's
|
* This routine allows the @tty driver to be notified when device's
|
||||||
* termios settings have changed. New settings are in @tty->termios.
|
* termios settings have changed. New settings are in @tty->termios.
|
||||||
|
@ -365,7 +365,7 @@ struct tty_operations {
|
||||||
unsigned int cmd, unsigned long arg);
|
unsigned int cmd, unsigned long arg);
|
||||||
long (*compat_ioctl)(struct tty_struct *tty,
|
long (*compat_ioctl)(struct tty_struct *tty,
|
||||||
unsigned int cmd, unsigned long arg);
|
unsigned int cmd, unsigned long arg);
|
||||||
void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
|
void (*set_termios)(struct tty_struct *tty, const struct ktermios *old);
|
||||||
void (*throttle)(struct tty_struct * tty);
|
void (*throttle)(struct tty_struct * tty);
|
||||||
void (*unthrottle)(struct tty_struct * tty);
|
void (*unthrottle)(struct tty_struct * tty);
|
||||||
void (*stop)(struct tty_struct *tty);
|
void (*stop)(struct tty_struct *tty);
|
||||||
|
|
|
@ -855,7 +855,8 @@ static int rfcomm_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned l
|
||||||
return -ENOIOCTLCMD;
|
return -ENOIOCTLCMD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rfcomm_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
|
static void rfcomm_tty_set_termios(struct tty_struct *tty,
|
||||||
|
const struct ktermios *old)
|
||||||
{
|
{
|
||||||
struct ktermios *new = &tty->termios;
|
struct ktermios *new = &tty->termios;
|
||||||
int old_baud_rate = tty_termios_baud_rate(old);
|
int old_baud_rate = tty_termios_baud_rate(old);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue