lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPLW+4mPB+uPssLLMXsdZ6Pj4V38FJg6N93PEhcXSZ1yUwkANA@mail.gmail.com>
Date: Tue, 16 Jan 2024 13:14:08 -0600
From: Sam Protsenko <semen.protsenko@...aro.org>
To: Tudor Ambarus <tudor.ambarus@...aro.org>
Cc: krzysztof.kozlowski@...aro.org, alim.akhtar@...sung.com, 
	gregkh@...uxfoundation.org, jirislaby@...nel.org, 
	linux-arm-kernel@...ts.infradead.org, linux-samsung-soc@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org, 
	andre.draszik@...aro.org, peter.griffin@...aro.org, kernel-team@...roid.com, 
	willmcvicker@...gle.com
Subject: Re: [PATCH 18/18] tty: serial: samsung: shrink memory footprint of
 ``struct s3c24xx_uart_info``

On Wed, Jan 10, 2024 at 4:26 AM Tudor Ambarus <tudor.ambarus@...aroorg> wrote:
>
> Use u32 for the members of ``struct s3c24xx_uart_info`` that are used
> for register interactions. The purpose of these members becomes clearer.
>
> The greater benefit of this change is that it also reduces the memory
> footprint of the struct, allowing 64-bit architectures to use a
> single cacheline for the entire struct.
>
> struct s3c24xx_uart_info {
>         const char  *              name;                 /*     0     8 */
>         enum s3c24xx_port_type     type;                 /*     8     4 */
>         unsigned int               port_type;            /*    12     4 */
>         unsigned int               fifosize;             /*    16     4 */
>         u32                        rx_fifomask;          /*    20     4 */
>         u32                        rx_fifoshift;         /*    24     4 */
>         u32                        rx_fifofull;          /*    28     4 */
>         u32                        tx_fifomask;          /*    32     4 */
>         u32                        tx_fifoshift;         /*    36     4 */
>         u32                        tx_fifofull;          /*    40     4 */
>         u32                        clksel_mask;          /*    44     4 */
>         u32                        clksel_shift;         /*    48     4 */
>         u32                        ucon_mask;            /*    52     4 */
>         u8                         def_clk_sel;          /*    56     1 */
>         u8                         num_clks;             /*    57     1 */
>         u8                         iotype;               /*    58     1 */
>         u8                         has_divslot:1;        /*    59: 0  1 */
>
>         /* size: 64, cachelines: 1, members: 17 */
>         /* padding: 4 */
>         /* bit_padding: 7 bits */
> };
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@...aro.org>
> ---

Reviewed-by: Sam Protsenko <semen.protsenko@...aro.org>

>  drivers/tty/serial/samsung_tty.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> index 598d9fe7a492..40dceb41acb7 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -75,15 +75,15 @@ struct s3c24xx_uart_info {
>         enum s3c24xx_port_type  type;
>         unsigned int            port_type;
>         unsigned int            fifosize;
> -       unsigned long           rx_fifomask;
> -       unsigned long           rx_fifoshift;
> -       unsigned long           rx_fifofull;
> -       unsigned long           tx_fifomask;
> -       unsigned long           tx_fifoshift;
> -       unsigned long           tx_fifofull;
> -       unsigned long           clksel_mask;
> -       unsigned long           clksel_shift;
> -       unsigned long           ucon_mask;
> +       u32                     rx_fifomask;
> +       u32                     rx_fifoshift;
> +       u32                     rx_fifofull;
> +       u32                     tx_fifomask;
> +       u32                     tx_fifoshift;
> +       u32                     tx_fifofull;
> +       u32                     clksel_mask;
> +       u32                     clksel_shift;
> +       u32                     ucon_mask;
>         u8                      def_clk_sel;
>         u8                      num_clks;
>         u8                      iotype;
> --
> 2.43.0.472.g3155946c3a-goog
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ