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]
Date:   Thu, 19 Aug 2021 08:36:44 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Colin King <colin.king@...onical.com>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
        alsa-devel@...a-project.org, linux-arm-kernel@...ts.infradead.org,
        kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: uniphier: make arrays mul and div static const,
 makes object smaller

On Wed, 18 Aug 2021 16:17:46 +0100
Colin King <colin.king@...onical.com> wrote:

> From: Colin Ian King <colin.king@...onical.com>
> 
> Don't populate the arrays mul and div on the stack but instead make them
> static const. Makes the object code smaller by 4 bytes.
> 
> Before:
>    text    data     bss     dec     hex filename
>   16226    4984      64   21274    531a ./sound/soc/uniphier/aio-cpu.o
> 
> After:
>    text    data     bss     dec     hex filename
>   16062    5144      64   21270    5316 ./sound/soc/uniphier/aio-cpu.o
> 
> (gcc version 10.2.0)

This looks good to me.

Acked-by: Masami Hiramatsu <mhiramat@...nel.org>

Thank you,

> 
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>  sound/soc/uniphier/aio-cpu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/uniphier/aio-cpu.c b/sound/soc/uniphier/aio-cpu.c
> index cf9814130067..4e8d5f7532ba 100644
> --- a/sound/soc/uniphier/aio-cpu.c
> +++ b/sound/soc/uniphier/aio-cpu.c
> @@ -128,8 +128,8 @@ static const struct uniphier_aio_spec *find_spec(struct uniphier_aio *aio,
>  static int find_divider(struct uniphier_aio *aio, int pll_id, unsigned int freq)
>  {
>  	struct uniphier_aio_pll *pll;
> -	int mul[] = { 1, 1, 1, 2, };
> -	int div[] = { 2, 3, 1, 3, };
> +	static const int mul[] = { 1, 1, 1, 2, };
> +	static const int div[] = { 2, 3, 1, 3, };
>  	int i;
>  
>  	if (!is_valid_pll(aio->chip, pll_id))
> -- 
> 2.32.0
> 


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ