diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2020-11-21 00:10:46 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2020-11-21 09:30:35 +0100 |
commit | e714fa93898f3b1050356a16bef72168166ade2a (patch) | |
tree | 329b7dbe2828197964bcb8e5120d98737ed17398 /sound/drivers | |
parent | 45bbe6c95e427511f8d5a401d886b5261c673e30 (diff) | |
download | linux-stable-e714fa93898f3b1050356a16bef72168166ade2a.tar.gz linux-stable-e714fa93898f3b1050356a16bef72168166ade2a.tar.bz2 linux-stable-e714fa93898f3b1050356a16bef72168166ade2a.zip |
ALSA: aloop: Constify ops structs
The only usage of the ops field in the loopback_cable struct is to call
its members, the field it self is never changed. Make it a pointer to
const. This allows us to constify two static loopback_ops structs to
allow the compiler to put them in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20201120231046.76758-1-rikard.falkeborn@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers')
-rw-r--r-- | sound/drivers/aloop.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index c91356326699..702f91b9c60f 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c @@ -105,7 +105,7 @@ struct loopback_cable { unsigned int running; unsigned int pause; /* timer specific */ - struct loopback_ops *ops; + const struct loopback_ops *ops; /* If sound timer is used */ struct { int stream; @@ -1021,7 +1021,7 @@ static int loopback_jiffies_timer_open(struct loopback_pcm *dpcm) return 0; } -static struct loopback_ops loopback_jiffies_timer_ops = { +static const struct loopback_ops loopback_jiffies_timer_ops = { .open = loopback_jiffies_timer_open, .start = loopback_jiffies_timer_start, .stop = loopback_jiffies_timer_stop, @@ -1172,7 +1172,7 @@ exit: /* stop_sync() is not required for sound timer because it does not need to be * restarted in loopback_prepare() on Xrun recovery */ -static struct loopback_ops loopback_snd_timer_ops = { +static const struct loopback_ops loopback_snd_timer_ops = { .open = loopback_snd_timer_open, .start = loopback_snd_timer_start, .stop = loopback_snd_timer_stop, |