ALSA: usb: Constify snd_pcm_hardware definitions
authorTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:16:18 +0000 (09:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:23:49 +0000 (09:23 +0100)
Most of snd_pcm_hardware definitions are just copied to another object
as-is, hence we can define them as const for further optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/caiaq/audio.c
sound/usb/usx2y/usbusx2yaudio.c
sound/usb/usx2y/usx2yhwdeppcm.c

index 72212153cb1f815049e34bdfd6add511fa54e2fb..41993a5c0537adb69153d942aa2226ad8cd3e18b 100644 (file)
@@ -30,7 +30,7 @@
 #define MAKE_CHECKBYTE(cdev,stream,i) \
        (stream << 1) | (~(i / (cdev->n_streams * BYTES_PER_SAMPLE_USB)) & 1)
 
-static struct snd_pcm_hardware snd_usb_caiaq_pcm_hardware = {
+static const struct snd_pcm_hardware snd_usb_caiaq_pcm_hardware = {
        .info           = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                           SNDRV_PCM_INFO_BLOCK_TRANSFER),
        .formats        = SNDRV_PCM_FMTBIT_S24_3BE,
index 8ac4ce0e8965af3363878690301b22c11f747b55..c7dbc0f94efb368c781e91bf8ccba50d4ef1d98d 100644 (file)
@@ -838,7 +838,7 @@ static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream)
        return err;
 }
 
-static struct snd_pcm_hardware snd_usX2Y_2c =
+static const struct snd_pcm_hardware snd_usX2Y_2c =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |
index d8d91f2fb7992c514583b7f2b73da09fbbe5de47..8253669c6a7d7f759460d1a5b9ebe64183fe8fe0 100644 (file)
@@ -528,7 +528,7 @@ static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream)
        return err;
 }
 
-static struct snd_pcm_hardware snd_usX2Y_4c =
+static const struct snd_pcm_hardware snd_usX2Y_4c =
 {
        .info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
                                 SNDRV_PCM_INFO_BLOCK_TRANSFER |