Skip to contentSkip to conversation

ASoC: rt1011: make array pd static const, makes object smaller

PATCH In review Colin King 2 participants 2 messages Sep 7, 2019 – Sep 9, 2019

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 ASoC: rt1011: make array pd static const, makes object smaller

From: Colin Ian King <[email protected]>

Don't populate the array pd on the stack but instead make it static const. Makes the object code smaller by 100 bytes.

Before:
text data bss dec hex filename
51463 13016 128 64607 fc5f sound/soc/codecs/rt1011.o

After:
text data bss dec hex filename
51299 13080 128 64507 fbfb sound/soc/codecs/rt1011.o

(gcc version 9.2.1, amd64)

---
 sound/soc/codecs/rt1011.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/rt1011.c +2 -1
index f9235764ad32..be1e276e3631 100644
@@ -1519,7 +1519,8 @@ static const struct snd_soc_dapm_route rt1011_dapm_routes[] = {
 
 static int rt1011_get_clk_info(int sclk, int rate)
 {
-	int i, pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
+	int i;
+	static const int pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
 
 	if (sclk <= 0 || rate <= 0)
 		return -EINVAL;
Signature · 1 line
2.20.1
maintainer
#1 lore raw

Applied "ASoC: rt1011: make array pd static const, makes object smaller" to the asoc tree

The patch

ASoC: rt1011: make array pd static const, makes object smaller

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

From 2b70d5776e8b173e3b36a2ef63d94428c6a80e1f Mon Sep 17 00:00:00 2001
From: Colin Ian King <[email protected]>
Date: Sat, 7 Sep 2019 08:37:17 +0100
Subject: [PATCH] ASoC: rt1011: make array pd static const, makes object
smaller

Don't populate the array pd on the stack but instead make it static const. Makes the object code smaller by 100 bytes.

Before:
text data bss dec hex filename
51463 13016 128 64607 fc5f sound/soc/codecs/rt1011.o

After:
text data bss dec hex filename
51299 13080 128 64507 fbfb sound/soc/codecs/rt1011.o

(gcc version 9.2.1, amd64)

---
 sound/soc/codecs/rt1011.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/rt1011.c +2 -1
index fa34565a3938..a92a0bacd812 100644
@@ -1519,7 +1519,8 @@ static const struct snd_soc_dapm_route rt1011_dapm_routes[] = {
 
 static int rt1011_get_clk_info(int sclk, int rate)
 {
-	int i, pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
+	int i;
+	static const int pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
 
 	if (sclk <= 0 || rate <= 0)
 		return -EINVAL;
Signature · 1 line
2.20.1