mxser: correct types for uart variables
authorJiri Slaby <jslaby@suse.cz>
Fri, 18 Jun 2021 06:14:24 +0000 (08:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jun 2021 11:09:59 +0000 (13:09 +0200)
In struct mxser_port, all the UART registers and masks, and the xon/xoff
character are stored into int. Let's re-type all these as UART registers
are 8bit (u8) and xon/xoff character is an unsigned char (cc_t in
ktermios).

This save some bytes in memory, but more importantly the change makes it
what it really is.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210618061516.662-19-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/mxser.c

index 1b8032c9351e542dd3d655ea64b589092cd59c82..45f36d92c5ea873476f8985392568efd73aed0e7 100644 (file)
@@ -335,9 +335,9 @@ struct mxser_port {
        int baud_base;          /* max. speed */
        int type;               /* UART type */
 
-       int x_char;             /* xon/xoff character */
-       int IER;                /* Interrupt Enable Register */
-       int MCR;                /* Modem control register */
+       unsigned char x_char;   /* xon/xoff character */
+       u8 IER;                 /* Interrupt Enable Register */
+       u8 MCR;                 /* Modem control register */
 
        unsigned char stop_rx;
        unsigned char ldisc_stop_rx;
@@ -348,8 +348,8 @@ struct mxser_port {
        struct async_icount icount; /* kernel counters for 4 input interrupts */
        unsigned int timeout;
 
-       int read_status_mask;
-       int ignore_status_mask;
+       u8 read_status_mask;
+       u8 ignore_status_mask;
        u8 xmit_fifo_size;
        int xmit_head;
        int xmit_tail;