Skip to content

Commit a4a1b73

Browse files
Colin Ian Kingtiwai
authored andcommitted
ALSA: drivers: make array 'names' const, reduces object code size
Don't populate array 'names' on the stack but instead make them static. Makes the object code smaller by 50 bytes: Before: text data bss dec hex filename 21237 9192 1120 31549 7b3d linux/sound/drivers/dummy.o After: text data bss dec hex filename 21095 9280 1120 31495 7b07 linux/sound/drivers/dummy.o (gcc version 7.2.0 x86_64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 4fbd8d1 commit a4a1b73

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sound/drivers/dummy.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ static int snd_dummy_capsrc_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el
830830
static int snd_dummy_iobox_info(struct snd_kcontrol *kcontrol,
831831
struct snd_ctl_elem_info *info)
832832
{
833-
const char *const names[] = { "None", "CD Player" };
833+
static const char *const names[] = { "None", "CD Player" };
834834

835835
return snd_ctl_enum_info(info, 1, 2, names);
836836
}

0 commit comments

Comments
 (0)