ALSA: timer: Constify snd_timer_hardware definitions
authorTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:16:36 +0000 (09:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:24:07 +0000 (09:24 +0100)
Most of snd_timer_hardware definitions do simply copying to another
struct as-is.  Mark them as const for further optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-21-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_timer.c
sound/core/timer.c

index 7928bda235c17f88836c11c148bf7f6967f16412..c43484b22b34ca82fd21fa284dceaf36556ac8c0 100644 (file)
@@ -75,7 +75,7 @@ static int snd_pcm_timer_stop(struct snd_timer * timer)
        return 0;
 }
 
-static struct snd_timer_hardware snd_pcm_timer =
+static const struct snd_timer_hardware snd_pcm_timer =
 {
        .flags =        SNDRV_TIMER_HW_AUTO | SNDRV_TIMER_HW_SLAVE,
        .resolution =   0,
index d53bc1f3a48a907435594cc2806b2110c8b7f82d..8835ff91a89374bbb6ff37c47dfa25143d99ce2f 100644 (file)
@@ -1199,7 +1199,7 @@ static int snd_timer_s_close(struct snd_timer *timer)
        return 0;
 }
 
-static struct snd_timer_hardware snd_timer_system =
+static const struct snd_timer_hardware snd_timer_system =
 {
        .flags =        SNDRV_TIMER_HW_FIRST | SNDRV_TIMER_HW_TASKLET,
        .resolution =   1000000000L / HZ,