ALSA: dummy: Constify snd_pcm_ops definitions
authorTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:16:59 +0000 (09:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:24:36 +0000 (09:24 +0100)
The snd_pcm_ops items defined in snd-dummy driver can be gracefully
declared as const.  Let's mark them for further optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-44-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/dummy.c

index cec682a..46fa60e 100644 (file)
@@ -644,7 +644,7 @@ static struct page *dummy_pcm_page(struct snd_pcm_substream *substream,
        return virt_to_page(dummy_page[substream->stream]); /* the same page */
 }
 
        return virt_to_page(dummy_page[substream->stream]); /* the same page */
 }
 
-static struct snd_pcm_ops dummy_pcm_ops = {
+static const struct snd_pcm_ops dummy_pcm_ops = {
        .open =         dummy_pcm_open,
        .close =        dummy_pcm_close,
        .hw_params =    dummy_pcm_hw_params,
        .open =         dummy_pcm_open,
        .close =        dummy_pcm_close,
        .hw_params =    dummy_pcm_hw_params,
@@ -653,7 +653,7 @@ static struct snd_pcm_ops dummy_pcm_ops = {
        .pointer =      dummy_pcm_pointer,
 };
 
        .pointer =      dummy_pcm_pointer,
 };
 
-static struct snd_pcm_ops dummy_pcm_ops_no_buf = {
+static const struct snd_pcm_ops dummy_pcm_ops_no_buf = {
        .open =         dummy_pcm_open,
        .close =        dummy_pcm_close,
        .hw_params =    dummy_pcm_hw_params,
        .open =         dummy_pcm_open,
        .close =        dummy_pcm_close,
        .hw_params =    dummy_pcm_hw_params,
@@ -670,7 +670,7 @@ static int snd_card_dummy_pcm(struct snd_dummy *dummy, int device,
                              int substreams)
 {
        struct snd_pcm *pcm;
                              int substreams)
 {
        struct snd_pcm *pcm;
-       struct snd_pcm_ops *ops;
+       const struct snd_pcm_ops *ops;
        int err;
 
        err = snd_pcm_new(dummy->card, "Dummy PCM", device,
        int err;
 
        err = snd_pcm_new(dummy->card, "Dummy PCM", device,