Skip to content

Commit

Permalink
ALSA: Constify snd_timer_hardware definitions
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 3, 2020
1 parent df76996 commit 5ff16a3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions sound/drivers/opl3/opl3_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static int snd_opl3_timer2_stop(struct snd_timer * timer)
*/

static struct snd_timer_hardware snd_opl3_timer1 =
static const struct snd_timer_hardware snd_opl3_timer1 =
{
.flags = SNDRV_TIMER_HW_STOP,
.resolution = 80000,
Expand All @@ -223,7 +223,7 @@ static struct snd_timer_hardware snd_opl3_timer1 =
.stop = snd_opl3_timer1_stop,
};

static struct snd_timer_hardware snd_opl3_timer2 =
static const struct snd_timer_hardware snd_opl3_timer2 =
{
.flags = SNDRV_TIMER_HW_STOP,
.resolution = 320000,
Expand Down
4 changes: 2 additions & 2 deletions sound/isa/gus/gus_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static void snd_gf1_interrupt_timer2(struct snd_gus_card * gus)
*/

static struct snd_timer_hardware snd_gf1_timer1 =
static const struct snd_timer_hardware snd_gf1_timer1 =
{
.flags = SNDRV_TIMER_HW_STOP,
.resolution = 80000,
Expand All @@ -117,7 +117,7 @@ static struct snd_timer_hardware snd_gf1_timer1 =
.stop = snd_gf1_timer1_stop,
};

static struct snd_timer_hardware snd_gf1_timer2 =
static const struct snd_timer_hardware snd_gf1_timer2 =
{
.flags = SNDRV_TIMER_HW_STOP,
.resolution = 320000,
Expand Down
2 changes: 1 addition & 1 deletion sound/isa/wss/wss_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ static int snd_wss_timer_close(struct snd_timer *timer)
return 0;
}

static struct snd_timer_hardware snd_wss_timer_table =
static const struct snd_timer_hardware snd_wss_timer_table =
{
.flags = SNDRV_TIMER_HW_AUTO,
.resolution = 9945,
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/emu10k1/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static int snd_emu10k1_timer_precise_resolution(struct snd_timer *timer,
return 0;
}

static struct snd_timer_hardware snd_emu10k1_timer_hw = {
static const struct snd_timer_hardware snd_emu10k1_timer_hw = {
.flags = SNDRV_TIMER_HW_AUTO,
.resolution = 20833, /* 1 sample @ 48KHZ = 20.833...us */
.ticks = 1024,
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ymfpci/ymfpci_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ static int snd_ymfpci_timer_precise_resolution(struct snd_timer *timer,
return 0;
}

static struct snd_timer_hardware snd_ymfpci_timer_hw = {
static const struct snd_timer_hardware snd_ymfpci_timer_hw = {
.flags = SNDRV_TIMER_HW_AUTO,
.resolution = 10417, /* 1 / 96 kHz = 10.41666...us */
.ticks = 0x10000,
Expand Down
2 changes: 1 addition & 1 deletion sound/sparc/cs4231.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ static int snd_cs4231_timer_close(struct snd_timer *timer)
return 0;
}

static struct snd_timer_hardware snd_cs4231_timer_table = {
static const struct snd_timer_hardware snd_cs4231_timer_table = {
.flags = SNDRV_TIMER_HW_AUTO,
.resolution = 9945,
.ticks = 65535,
Expand Down

0 comments on commit 5ff16a3

Please sign in to comment.