From: Masami Hiramatsu <mhiramat@kernel.org>
To: Colin King <colin.king@canonical.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
alsa-devel@alsa-project.org,
linux-arm-kernel@lists.infradead.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: uniphier: make arrays mul and div static const, makes object smaller
Date: Thu, 19 Aug 2021 08:36:44 +0900 [thread overview]
Message-ID: <20210819083644.6c88a29eef5926eca76cffcb@kernel.org> (raw)
In-Reply-To: <20210818151746.38520-1-colin.king@canonical.com>
On Wed, 18 Aug 2021 16:17:46 +0100
Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.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@kernel.org>
Thank you,
>
> Signed-off-by: Colin Ian King <colin.king@canonical.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@kernel.org>
next prev parent reply other threads:[~2021-08-18 23:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-18 15:17 [PATCH] ASoC: uniphier: make arrays mul and div static const, makes object smaller Colin King
2021-08-18 23:36 ` Masami Hiramatsu [this message]
2021-08-19 19:22 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210819083644.6c88a29eef5926eca76cffcb@kernel.org \
--to=mhiramat@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=colin.king@canonical.com \
--cc=hayashi.kunihiko@socionext.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).