]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: Intel: make const arrays static, reduces object code size
authorColin Ian King <colin.king@canonical.com>
Thu, 24 Jan 2019 17:37:35 +0000 (17:37 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 24 Jan 2019 19:27:30 +0000 (19:27 +0000)
Don't populate the const arrays on the stack but instead make
it static. Makes the object code smaller, for example:

Before:
   text    data     bss     dec     hex filename
  14107    8832     224   23163    5a7b bytcht_es8316.o

After:
   text    data     bss     dec     hex filename
  14015    8896     224   23135    5a5f bytcht_es8316.o

(gcc version 8.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/bytcht_es8316.c
sound/soc/intel/boards/bytcr_rt5640.c
sound/soc/intel/boards/bytcr_rt5651.c

index fa9c4cf97686d9704ac8ff3617a9e8546fc3548d..1364e4e601d837a9ee07fb9ef4f0b84f7e9f40cc 100644 (file)
@@ -437,7 +437,7 @@ static const struct acpi_gpio_mapping byt_cht_es8316_gpios[] = {
 
 static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev)
 {
-       const char * const mic_name[] = { "in1", "in2" };
+       static const char * const mic_name[] = { "in1", "in2" };
        struct byt_cht_es8316_private *priv;
        struct device *dev = &pdev->dev;
        struct snd_soc_acpi_mach *mach;
index ca8b4d5ff70f9f1744e6d10e65d8f6945d8e0f20..a79466c8fb29615af0cb15608125c10b863cf7a1 100644 (file)
@@ -1149,7 +1149,7 @@ struct acpi_chan_package {   /* ACPICA seems to require 64 bit integers */
 
 static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
 {
-       const char * const map_name[] = { "dmic1", "dmic2", "in1", "in3" };
+       static const char * const map_name[] = { "dmic1", "dmic2", "in1", "in3" };
        const struct dmi_system_id *dmi_id;
        struct byt_rt5640_private *priv;
        struct snd_soc_acpi_mach *mach;
index b618d984e2d566c7a044940dd6fd3dc2063dcca9..e6945d11c8abde6b47e61504185e83680919c412 100644 (file)
@@ -919,7 +919,7 @@ struct acpi_chan_package {   /* ACPICA seems to require 64 bit integers */
 
 static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
 {
-       const char * const mic_name[] = { "dmic", "in1", "in2", "in12" };
+       static const char * const mic_name[] = { "dmic", "in1", "in2", "in12" };
        struct byt_rt5651_private *priv;
        struct snd_soc_acpi_mach *mach;
        struct device *codec_dev;