Skip to contentSkip to conversation

cx88: Remove duplicate const

PATCH In review Emil Goode 2 participants 2 messages May 4, 2012

Subsystems (2)
lore
Share & tools
lore

Emil Goode

author
#0 lore raw

PATCH 1/1 cx88: Remove duplicate const

This patch fixes the following sparse warnings
by removing use of duplicate const.

drivers/media/video/cx88/cx88.h:152:40:
warning: duplicate const
drivers/media/video/cx88/cx88-core.c:256:33:
warning: duplicate const
drivers/media/video/cx88/cx88-alsa.c:769:41:
warning: duplicate const

---
 drivers/media/video/cx88/cx88-alsa.c |    2 +-
 drivers/media/video/cx88/cx88-core.c |    2 +-
 drivers/media/video/cx88/cx88.h      |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/media/video/cx88/cx88-alsa.c +1 -1
index 04bf662..408e3c9 100644
@@ -766,7 +766,7 @@ static struct snd_kcontrol_new snd_cx88_alc_switch = {
  * Only boards with eeprom and byte 1 at eeprom=1 have it
  */
 
-static const struct pci_device_id const cx88_audio_pci_tbl[] __devinitdata = {
+static const struct pci_device_id cx88_audio_pci_tbl[] __devinitdata = {
 	{0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
 	{0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
 	{0, }
drivers/media/video/cx88/cx88-core.c +1 -1
index fbfdd80..dbd2fa2 100644
@@ -253,7 +253,7 @@ cx88_free_buffer(struct videobuf_queue *q, struct cx88_buffer *buf)
  *    0x0c00 -           FIFOs
  */
 
-const struct sram_channel const cx88_sram_channels[] = {
+const struct sram_channel cx88_sram_channels[] = {
 	[SRAM_CH21] = {
 		.name       = "video y / packed",
 		.cmds_start = 0x180040,
drivers/media/video/cx88/cx88.h +1 -1
index c9659de..aabec7e 100644
@@ -149,7 +149,7 @@ struct sram_channel {
 	u32  cnt1_reg;
 	u32  cnt2_reg;
 };
-extern const struct sram_channel const cx88_sram_channels[];
+extern const struct sram_channel cx88_sram_channels[];
 
 /* ----------------------------------------------------------- */
 /* card configuration                                          */
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Emil Goode

This patch fixes the following sparse warnings
by removing use of duplicate const.

Is this really just about quieting sparse noise?

I would find it clearer to read a more straightforward explanation like

Remove some redundant uses of "const" detected by sparse:

but that is only a nitpick.

[...]

drivers/media/video/cx88/cx88-alsa.c static struct snd_kcontrol_new snd_cx88_alc_switch = { · line 769

Quoted 8 lines
drivers/media/video/cx88/cx88-alsa.c +1 -1
@@ -766,7 +766,7 @@ static struct snd_kcontrol_new snd_cx88_alc_switch = {
  * Only boards with eeprom and byte 1 at eeprom=1 have it
  */
 
-static const struct pci_device_id const cx88_audio_pci_tbl[] __devinitdata = {
+static const struct pci_device_id cx88_audio_pci_tbl[] __devinitdata = {

These double "const" were introduced in v2.6.37-rc1~64^2~464 (V4L/DVB:
drivers/media: Make static data tables and strings const, 2010-08-25).

The address of an array is already immutable by definition, so for what it's worth, with or without a clarified commit message,