Skip to content

Commit 9ce88a1

Browse files
Colin Ian Kingtiwai
authored andcommitted
ALSA: hda/ca0132: make some const arrays static, makes object smaller
Don't populate const arrays on the stack but instead make them static. Makes the object code smaller by 57 bytes. Before: text data bss dec hex filename 173256 38016 192 211464 33a08 sound/pci/hda/patch_ca0132.o After: text data bss dec hex filename 172879 38336 192 211407 339cf sound/pci/hda/patch_ca0132.o (gcc version 10.2.0) Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20201016224913.687724-1-colin.king@canonical.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent a97cbcd commit 9ce88a1

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

sound/pci/hda/patch_ca0132.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7910,8 +7910,12 @@ static void ae7_post_dsp_asi_stream_setup(struct hda_codec *codec)
79107910

79117911
static void ae7_post_dsp_pll_setup(struct hda_codec *codec)
79127912
{
7913-
const unsigned int addr[] = { 0x41, 0x45, 0x40, 0x43, 0x51 };
7914-
const unsigned int data[] = { 0xc8, 0xcc, 0xcb, 0xc7, 0x8d };
7913+
static const unsigned int addr[] = {
7914+
0x41, 0x45, 0x40, 0x43, 0x51
7915+
};
7916+
static const unsigned int data[] = {
7917+
0xc8, 0xcc, 0xcb, 0xc7, 0x8d
7918+
};
79157919
unsigned int i;
79167920

79177921
for (i = 0; i < ARRAY_SIZE(addr); i++) {
@@ -7925,10 +7929,12 @@ static void ae7_post_dsp_pll_setup(struct hda_codec *codec)
79257929
static void ae7_post_dsp_asi_setup_ports(struct hda_codec *codec)
79267930
{
79277931
struct ca0132_spec *spec = codec->spec;
7928-
const unsigned int target[] = { 0x0b, 0x04, 0x06, 0x0a, 0x0c, 0x11,
7929-
0x12, 0x13, 0x14 };
7930-
const unsigned int data[] = { 0x12, 0x00, 0x48, 0x05, 0x5f, 0xff,
7931-
0xff, 0xff, 0x7f };
7932+
static const unsigned int target[] = {
7933+
0x0b, 0x04, 0x06, 0x0a, 0x0c, 0x11, 0x12, 0x13, 0x14
7934+
};
7935+
static const unsigned int data[] = {
7936+
0x12, 0x00, 0x48, 0x05, 0x5f, 0xff, 0xff, 0xff, 0x7f
7937+
};
79327938
unsigned int i;
79337939

79347940
mutex_lock(&spec->chipio_mutex);

0 commit comments

Comments
 (0)