Skip to content

Commit

Permalink
ALSA: i2c: constify snd_i2c_ops structures
Browse files Browse the repository at this point in the history
The snd_i2c_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
JuliaLawall authored and tiwai committed Nov 30, 2015
1 parent b17154c commit 5df29bc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/sound/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct snd_i2c_bus {
struct snd_i2c_bit_ops *bit;
void *ops;
} hw_ops; /* lowlevel operations */
struct snd_i2c_ops *ops; /* midlevel operations */
const struct snd_i2c_ops *ops; /* midlevel operations */

unsigned long private_value;
void *private_data;
Expand Down
2 changes: 1 addition & 1 deletion sound/i2c/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int snd_i2c_bit_readbytes(struct snd_i2c_device *device,
static int snd_i2c_bit_probeaddr(struct snd_i2c_bus *bus,
unsigned short addr);

static struct snd_i2c_ops snd_i2c_bit_ops = {
static const struct snd_i2c_ops snd_i2c_bit_ops = {
.sendbytes = snd_i2c_bit_sendbytes,
.readbytes = snd_i2c_bit_readbytes,
.probeaddr = snd_i2c_bit_probeaddr,
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ice1712/delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static int ap_cs8427_probeaddr(struct snd_i2c_bus *bus, unsigned short addr)
return -ENOENT;
}

static struct snd_i2c_ops ap_cs8427_i2c_ops = {
static const struct snd_i2c_ops ap_cs8427_i2c_ops = {
.sendbytes = ap_cs8427_sendbytes,
.readbytes = ap_cs8427_readbytes,
.probeaddr = ap_cs8427_probeaddr,
Expand Down

0 comments on commit 5df29bc

Please sign in to comment.