ALSA: core: Constify snd_device_ops definitions
authorTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:16:20 +0000 (09:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:23:51 +0000 (09:23 +0100)
Now we may declare const for snd_device_ops definitions, so let's do
it for optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/compress_offload.c
sound/core/control.c
sound/core/hwdep.c
sound/core/jack.c
sound/core/pcm.c
sound/core/rawmidi.c
sound/core/seq_device.c
sound/core/timer.c

index f34ce564d92c481791c4121c5b4c8b64f953be9e..9de1c9a0173e0480b9636a5d738b4277c90fc406 100644 (file)
@@ -1099,7 +1099,7 @@ static int snd_compress_dev_free(struct snd_device *device)
 int snd_compress_new(struct snd_card *card, int device,
                        int dirn, const char *id, struct snd_compr *compr)
 {
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_compress_dev_free,
                .dev_register = snd_compress_dev_register,
                .dev_disconnect = snd_compress_dev_disconnect,
index 4728f6828890629cce0cf70639de87eab9a4b365..63bb2fcf13be895e9df1f0b7afdfe89a0cf7369a 100644 (file)
@@ -1823,7 +1823,7 @@ static int snd_ctl_dev_free(struct snd_device *device)
  */
 int snd_ctl_create(struct snd_card *card)
 {
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_ctl_dev_free,
                .dev_register = snd_ctl_dev_register,
                .dev_disconnect = snd_ctl_dev_disconnect,
index 00cb5aed10a9a2ab023ab2a54fc646cc0e4add3e..b412d3b3d5ffcbf95ba11edc5ab7154548e4b1d9 100644 (file)
@@ -353,7 +353,7 @@ int snd_hwdep_new(struct snd_card *card, char *id, int device,
 {
        struct snd_hwdep *hwdep;
        int err;
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_hwdep_dev_free,
                .dev_register = snd_hwdep_dev_register,
                .dev_disconnect = snd_hwdep_dev_disconnect,
index fb26196571a7cbbe8ac11315c67e64b181979e44..6590b1b8d62a0c3c7c15fb3a0c88916fa5aa679f 100644 (file)
@@ -201,7 +201,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
        struct snd_jack *jack;
        struct snd_jack_kctl *jack_kctl = NULL;
        int err;
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_jack_dev_free,
 #ifdef CONFIG_SND_JACK_INPUT_DEV
                .dev_register = snd_jack_dev_register,
index 85db55ea49fd740ecdbdc838488183f6ec6bb46f..a0f704b72a78ac996c102431be177986ea2ad474 100644 (file)
@@ -706,12 +706,12 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device,
 {
        struct snd_pcm *pcm;
        int err;
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_pcm_dev_free,
                .dev_register = snd_pcm_dev_register,
                .dev_disconnect = snd_pcm_dev_disconnect,
        };
-       static struct snd_device_ops internal_ops = {
+       static const struct snd_device_ops internal_ops = {
                .dev_free = snd_pcm_dev_free,
        };
 
index cd9bbb546846b95076983ca26464a11750366c0c..7bc95c24f7244cce7798cea3d6f2fa270ae3812e 100644 (file)
@@ -1621,7 +1621,7 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device,
 {
        struct snd_rawmidi *rmidi;
        int err;
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_rawmidi_dev_free,
                .dev_register = snd_rawmidi_dev_register,
                .dev_disconnect = snd_rawmidi_dev_disconnect,
index e9dbad93f9d09da4acf542a77169dee0e8b0560f..7ed13cb32ef82bf73db73330b434c244e02f7de8 100644 (file)
@@ -193,7 +193,7 @@ int snd_seq_device_new(struct snd_card *card, int device, const char *id,
 {
        struct snd_seq_device *dev;
        int err;
-       static struct snd_device_ops dops = {
+       static const struct snd_device_ops dops = {
                .dev_free = snd_seq_device_dev_free,
                .dev_register = snd_seq_device_dev_register,
                .dev_disconnect = snd_seq_device_dev_disconnect,
index 4cfd8e691903d17356e5d00d429cc18e58a6714f..d53bc1f3a48a907435594cc2806b2110c8b7f82d 100644 (file)
@@ -936,7 +936,7 @@ int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid,
 {
        struct snd_timer *timer;
        int err;
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_timer_dev_free,
                .dev_register = snd_timer_dev_register,
                .dev_disconnect = snd_timer_dev_disconnect,