Skip to contentSkip to conversation

ALSA: hrtimer: make hrtimer_hw const and __initconst

PATCH Applied Bhumika Goyal 2 participants 2 messages Sep 19, 2017 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hrtimer: make hrtimer_hw const and __initconst

Make this const as it is only used during a copy operation. Also, make it __initconst as it is only used during the init phase and after this it is not referenced anywhere.

---
 sound/core/hrtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/core/hrtimer.c +1 -1
index 1ac0c42..5603e49 100644
@@ -127,7 +127,7 @@ static int snd_hrtimer_stop(struct snd_timer *t)
 	return 0;
 }
 
-static struct snd_timer_hardware hrtimer_hw = {
+static const struct snd_timer_hardware hrtimer_hw __initconst = {
 	.flags =	SNDRV_TIMER_HW_AUTO | SNDRV_TIMER_HW_TASKLET,
 	.open =		snd_hrtimer_open,
 	.close =	snd_hrtimer_close,
Signature · 1 line
1.9.1
Applied
#1 lore raw
Quoted 6 lines · Bhumika Goyal

Make this const as it is only used during a copy operation. Also, make it __initconst as it is only used during the init phase and after this it is not referenced anywhere.

Applied, thanks.

Takashi