serial: 8250: Reorder fields in 'struct plat_serial8250_port'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 17 Feb 2023 20:22:57 +0000 (21:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Mar 2023 16:17:10 +0000 (17:17 +0100)
Group some variables based on their sizes to reduce hole and avoid padding.
On x86_64, this shrinks the size of 'struct plat_serial8250_port'
from 144 to 128 bytes.

It saves a few bytes of memory.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f3cb1efe1454e0615840fd331ee335bc441589a9.1676665358.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/serial_8250.h

index 19376be..741ed48 100644 (file)
@@ -18,16 +18,16 @@ struct plat_serial8250_port {
        unsigned long   iobase;         /* io base address */
        void __iomem    *membase;       /* ioremap cookie or NULL */
        resource_size_t mapbase;        /* resource base */
+       unsigned int    uartclk;        /* UART clock rate */
        unsigned int    irq;            /* interrupt number */
        unsigned long   irqflags;       /* request_irq flags */
-       unsigned int    uartclk;        /* UART clock rate */
        void            *private_data;
        unsigned char   regshift;       /* register shift */
        unsigned char   iotype;         /* UPIO_* */
        unsigned char   hub6;
        unsigned char   has_sysrq;      /* supports magic SysRq */
-       upf_t           flags;          /* UPF_* flags */
        unsigned int    type;           /* If UPF_FIXED_TYPE */
+       upf_t           flags;          /* UPF_* flags */
        unsigned int    (*serial_in)(struct uart_port *, int);
        void            (*serial_out)(struct uart_port *, int, int);
        void            (*set_termios)(struct uart_port *,