Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: i2c: constify snd_i2c_ops structures

The snd_i2c_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Julia Lawall and committed by
Takashi Iwai
5df29bca b17154cf

+3 -3
+1 -1
include/sound/i2c.h
··· 66 66 struct snd_i2c_bit_ops *bit; 67 67 void *ops; 68 68 } hw_ops; /* lowlevel operations */ 69 - struct snd_i2c_ops *ops; /* midlevel operations */ 69 + const struct snd_i2c_ops *ops; /* midlevel operations */ 70 70 71 71 unsigned long private_value; 72 72 void *private_data;
+1 -1
sound/i2c/i2c.c
··· 39 39 static int snd_i2c_bit_probeaddr(struct snd_i2c_bus *bus, 40 40 unsigned short addr); 41 41 42 - static struct snd_i2c_ops snd_i2c_bit_ops = { 42 + static const struct snd_i2c_ops snd_i2c_bit_ops = { 43 43 .sendbytes = snd_i2c_bit_sendbytes, 44 44 .readbytes = snd_i2c_bit_readbytes, 45 45 .probeaddr = snd_i2c_bit_probeaddr,
+1 -1
sound/pci/ice1712/delta.c
··· 174 174 return -ENOENT; 175 175 } 176 176 177 - static struct snd_i2c_ops ap_cs8427_i2c_ops = { 177 + static const struct snd_i2c_ops ap_cs8427_i2c_ops = { 178 178 .sendbytes = ap_cs8427_sendbytes, 179 179 .readbytes = ap_cs8427_readbytes, 180 180 .probeaddr = ap_cs8427_probeaddr,