Skip to contentSkip to conversation

drivers: make snd_pcm_hardware const

PATCH New Bhumika Goyal 1 participant 7 messages Aug 13, 2017

Subsystems (15)
lore
Share & tools
lore
#0 lore raw

cover drivers: make snd_pcm_hardware const

Make snd_pcm_hardware structures const.

Bhumika Goyal (6):
[media] usb: make snd_pcm_hardware const [media] pci: make snd_pcm_hardware const
drm: bridge: dw-hdmi: make snd_pcm_hardware const
usb: gadget: make snd_pcm_hardware const
staging: bcm2835-audio: make snd_pcm_hardware const [media] tuners: make snd_pcm_hardware const

 drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c       | 2 +-
 drivers/media/pci/cobalt/cobalt-alsa-pcm.c                | 4 ++--
 drivers/media/pci/cx18/cx18-alsa-pcm.c                    | 2 +-
 drivers/media/pci/cx23885/cx23885-alsa.c                  | 2 +-
 drivers/media/pci/cx25821/cx25821-alsa.c                  | 2 +-
 drivers/media/pci/ivtv/ivtv-alsa-pcm.c                    | 2 +-
 drivers/media/pci/saa7134/saa7134-alsa.c                  | 2 +-
 drivers/media/tuners/tda18271-maps.c                      | 4 ++--
 drivers/media/usb/cx231xx/cx231xx-audio.c                 | 2 +-
 drivers/media/usb/em28xx/em28xx-audio.c                   | 2 +-
 drivers/media/usb/go7007/snd-go7007.c                     | 2 +-
 drivers/media/usb/tm6000/tm6000-alsa.c                    | 2 +-
 drivers/media/usb/usbtv/usbtv-audio.c                     | 2 +-
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 4 ++--
 drivers/usb/gadget/function/u_audio.c                     | 2 +-
 15 files changed, 18 insertions(+), 18 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/6 usb: make snd_pcm_hardware const

Make these const as they are only used during a copy operation. Done using Coccinelle.

---
 drivers/media/usb/cx231xx/cx231xx-audio.c | 2 +-
 drivers/media/usb/em28xx/em28xx-audio.c   | 2 +-
 drivers/media/usb/go7007/snd-go7007.c     | 2 +-
 drivers/media/usb/tm6000/tm6000-alsa.c    | 2 +-
 drivers/media/usb/usbtv/usbtv-audio.c     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
drivers/media/usb/cx231xx/cx231xx-audio.c +1 -1
index a050d12..06f10d7 100644
@@ -403,7 +403,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
 	return 0;
 }
 
-static struct snd_pcm_hardware snd_cx231xx_hw_capture = {
+static const struct snd_pcm_hardware snd_cx231xx_hw_capture = {
 	.info = SNDRV_PCM_INFO_BLOCK_TRANSFER 	|
 	    SNDRV_PCM_INFO_MMAP 		|
 	    SNDRV_PCM_INFO_INTERLEAVED 		|
drivers/media/usb/em28xx/em28xx-audio.c +1 -1
index ffad7f1..261620a 100644
@@ -216,7 +216,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
 	return 0;
 }
 
-static struct snd_pcm_hardware snd_em28xx_hw_capture = {
+static const struct snd_pcm_hardware snd_em28xx_hw_capture = {
 	.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		SNDRV_PCM_INFO_MMAP           |
 		SNDRV_PCM_INFO_INTERLEAVED    |
drivers/media/usb/go7007/snd-go7007.c +1 -1
index 070871f..c618764 100644
@@ -52,7 +52,7 @@ struct go7007_snd {
 	int capturing;
 };
 
-static struct snd_pcm_hardware go7007_snd_capture_hw = {
+static const struct snd_pcm_hardware go7007_snd_capture_hw = {
 	.info			= (SNDRV_PCM_INFO_MMAP |
 					SNDRV_PCM_INFO_INTERLEAVED |
 					SNDRV_PCM_INFO_BLOCK_TRANSFER |
drivers/media/usb/tm6000/tm6000-alsa.c +1 -1
index 4223225..3717a68 100644
@@ -143,7 +143,7 @@ static int dsp_buffer_alloc(struct snd_pcm_substream *substream, int size)
  */
 #define DEFAULT_FIFO_SIZE	4096
 
-static struct snd_pcm_hardware snd_tm6000_digital_hw = {
+static const struct snd_pcm_hardware snd_tm6000_digital_hw = {
 	.info = SNDRV_PCM_INFO_BATCH |
 		SNDRV_PCM_INFO_MMAP |
 		SNDRV_PCM_INFO_INTERLEAVED |
drivers/media/usb/usbtv/usbtv-audio.c +1 -1
index 9db31db..2c2ca77 100644
@@ -43,7 +43,7 @@
 
 #include "usbtv.h"
 
-static struct snd_pcm_hardware snd_usbtv_digital_hw = {
+static const struct snd_pcm_hardware snd_usbtv_digital_hw = {
 	.info = SNDRV_PCM_INFO_BATCH |
 		SNDRV_PCM_INFO_MMAP |
 		SNDRV_PCM_INFO_INTERLEAVED |
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/6 pci: make snd_pcm_hardware const

In reply to Bhumika Goyal

Make these const as they are only used during a copy operation. Done using Coccinelle.

---
 drivers/media/pci/cobalt/cobalt-alsa-pcm.c | 4 ++--
 drivers/media/pci/cx18/cx18-alsa-pcm.c     | 2 +-
 drivers/media/pci/cx23885/cx23885-alsa.c   | 2 +-
 drivers/media/pci/cx25821/cx25821-alsa.c   | 2 +-
 drivers/media/pci/ivtv/ivtv-alsa-pcm.c     | 2 +-
 drivers/media/pci/saa7134/saa7134-alsa.c   | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)
drivers/media/pci/cobalt/cobalt-alsa-pcm.c +2 -2
index 49013c6..b69b258 100644
@@ -43,7 +43,7 @@
 			pr_info("cobalt-alsa-pcm %s: " fmt, __func__, ##arg); \
 	} while (0)
 
-static struct snd_pcm_hardware snd_cobalt_hdmi_capture = {
+static const struct snd_pcm_hardware snd_cobalt_hdmi_capture = {
 	.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		SNDRV_PCM_INFO_MMAP           |
 		SNDRV_PCM_INFO_INTERLEAVED    |
@@ -64,7 +64,7 @@
 	.periods_max = 4,
 };
 
-static struct snd_pcm_hardware snd_cobalt_playback = {
+static const struct snd_pcm_hardware snd_cobalt_playback = {
 	.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		SNDRV_PCM_INFO_MMAP           |
 		SNDRV_PCM_INFO_INTERLEAVED    |
drivers/media/pci/cx18/cx18-alsa-pcm.c +1 -1
index f68ee57..aadd764 100644
@@ -44,7 +44,7 @@
 				  __func__, ##arg); 			\
 	} while (0)
 
-static struct snd_pcm_hardware snd_cx18_hw_capture = {
+static const struct snd_pcm_hardware snd_cx18_hw_capture = {
 	.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		SNDRV_PCM_INFO_MMAP           |
 		SNDRV_PCM_INFO_INTERLEAVED    |
drivers/media/pci/cx23885/cx23885-alsa.c +1 -1
index c148f9a..d8c3637 100644
@@ -293,7 +293,7 @@ static int dsp_buffer_free(struct cx23885_audio_dev *chip)
  */
 #define DEFAULT_FIFO_SIZE	4096
 
-static struct snd_pcm_hardware snd_cx23885_digital_hw = {
+static const struct snd_pcm_hardware snd_cx23885_digital_hw = {
 	.info = SNDRV_PCM_INFO_MMAP |
 		SNDRV_PCM_INFO_INTERLEAVED |
 		SNDRV_PCM_INFO_BLOCK_TRANSFER |
drivers/media/pci/cx25821/cx25821-alsa.c +1 -1
index 519b81c..2b34990 100644
@@ -428,7 +428,7 @@ static int dsp_buffer_free(struct cx25821_audio_dev *chip)
  * Digital hardware definition
  */
 #define DEFAULT_FIFO_SIZE	384
-static struct snd_pcm_hardware snd_cx25821_digital_hw = {
+static const struct snd_pcm_hardware snd_cx25821_digital_hw = {
 	.info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
 		SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID,
 	.formats = SNDRV_PCM_FMTBIT_S16_LE,
drivers/media/pci/ivtv/ivtv-alsa-pcm.c +1 -1
index 417d03d..5326d86 100644
@@ -41,7 +41,7 @@
 			pr_info("ivtv-alsa-pcm %s: " fmt, __func__, ##arg); \
 	} while (0)
 
-static struct snd_pcm_hardware snd_ivtv_hw_capture = {
+static const struct snd_pcm_hardware snd_ivtv_hw_capture = {
 	.info = SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		SNDRV_PCM_INFO_MMAP           |
 		SNDRV_PCM_INFO_INTERLEAVED    |
drivers/media/pci/saa7134/saa7134-alsa.c +1 -1
index bf358ec..c59b69f 100644
@@ -627,7 +627,7 @@ static int snd_card_saa7134_capture_prepare(struct snd_pcm_substream * substream
  *    switching to 32kHz without any frequency translation
  */
 
-static struct snd_pcm_hardware snd_card_saa7134_capture =
+static const struct snd_pcm_hardware snd_card_saa7134_capture =
 {
 	.info =                 (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
 				 SNDRV_PCM_INFO_BLOCK_TRANSFER |
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/6 drm: bridge: dw-hdmi: make snd_pcm_hardware const

In reply to Bhumika Goyal

Make this const as it is only used during a copy operation. Done using Coccinelle.

---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c +1 -1
index cf3f0ca..b161439 100644
@@ -298,7 +298,7 @@ static irqreturn_t snd_dw_hdmi_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static struct snd_pcm_hardware dw_hdmi_hw = {
+static const struct snd_pcm_hardware dw_hdmi_hw = {
 	.info = SNDRV_PCM_INFO_INTERLEAVED |
 		SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		SNDRV_PCM_INFO_MMAP |
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/6 usb: gadget: make snd_pcm_hardware const

In reply to Bhumika Goyal

Make this const as it is only used during a copy operation. Done using Coccinelle.

---
 drivers/usb/gadget/function/u_audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/function/u_audio.c +1 -1
index d4caa21..3971bba 100644
@@ -79,7 +79,7 @@ struct snd_uac_chip {
 	unsigned int p_framesize;
 };
 
-static struct snd_pcm_hardware uac_pcm_hardware = {
+static const struct snd_pcm_hardware uac_pcm_hardware = {
 	.info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER
 		 | SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID
 		 | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME,
Signature · 1 line
1.9.1
#5 lore raw

PATCH 5/6 staging: bcm2835-audio: make snd_pcm_hardware const

In reply to Bhumika Goyal

Make these const as they are only used during a copy operation. Done using Coccinelle.

---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c +2 -2
index 1bf34ce..94654c0 100644
@@ -20,7 +20,7 @@
 #include "bcm2835.h"
 
 /* hardware definition */
-static struct snd_pcm_hardware snd_bcm2835_playback_hw = {
+static const struct snd_pcm_hardware snd_bcm2835_playback_hw = {
 	.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
 	SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
 	.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
@@ -36,7 +36,7 @@
 	.periods_max = 128,
 };
 
-static struct snd_pcm_hardware snd_bcm2835_playback_spdif_hw = {
+static const struct snd_pcm_hardware snd_bcm2835_playback_spdif_hw = {
 	.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
 	SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID),
 	.formats = SNDRV_PCM_FMTBIT_S16_LE,
Signature · 1 line
1.9.1
#6 lore raw

PATCH 6/6 tuners: make snd_pcm_hardware const

In reply to Bhumika Goyal

Make these const as they are only used during a copy operation. Done using Coccinelle.

---
 drivers/media/tuners/tda18271-maps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/tuners/tda18271-maps.c +2 -2
index 7d11467..9679804 100644
@@ -1182,7 +1182,7 @@ int tda18271_lookup_map(struct dvb_frontend *fe,
 
 /*---------------------------------------------------------------------*/
 
-static struct tda18271_std_map tda18271c1_std_map = {
+static const struct tda18271_std_map tda18271c1_std_map = {
 	.fm_radio = { .if_freq = 1250, .fm_rfn = 1, .agc_mode = 3, .std = 0,
 		      .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x18 */
 	.atv_b    = { .if_freq = 6750, .fm_rfn = 0, .agc_mode = 1, .std = 6,
@@ -1215,7 +1215,7 @@ int tda18271_lookup_map(struct dvb_frontend *fe,
 		      .if_lvl = 1, .rfagc_top = 0x37, }, /* EP3[4:0] 0x1f */
 };
 
-static struct tda18271_std_map tda18271c2_std_map = {
+static const struct tda18271_std_map tda18271c2_std_map = {
 	.fm_radio = { .if_freq = 1250, .fm_rfn = 1, .agc_mode = 3, .std = 0,
 		      .if_lvl = 0, .rfagc_top = 0x2c, }, /* EP3[4:0] 0x18 */
 	.atv_b    = { .if_freq = 6000, .fm_rfn = 0, .agc_mode = 1, .std = 5,
Signature · 1 line
1.9.1