diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2016-08-29 15:12:01 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-19 21:27:02 +0200 |
commit | 78f2c50bb4e1884318542cc5f674afb106555273 (patch) | |
tree | c50077b5d7a9f352a73e994b6b49e29e87e8cdfd /drivers/media/pci/saa7134 | |
parent | [media] Input: v4l-touch - add copyright lines (diff) | |
download | linux-78f2c50bb4e1884318542cc5f674afb106555273.tar.xz linux-78f2c50bb4e1884318542cc5f674afb106555273.zip |
[media] constify i2c_algorithm structures
These i2c_algorithm structures are only stored in the alg field of an
i2c_adapter structure, which is declared as const. This declare the
structures as const as well.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct i2c_algorithm i@p = { ... };
@ok@
identifier r.i;
struct i2c_adapter e;
position p;
@@
e.alg = &i@p;
@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct i2c_algorithm i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/saa7134')
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-i2c.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/pci/saa7134/saa7134-i2c.c b/drivers/media/pci/saa7134/saa7134-i2c.c index 8ef6399d794f..2dac48fa1386 100644 --- a/drivers/media/pci/saa7134/saa7134-i2c.c +++ b/drivers/media/pci/saa7134/saa7134-i2c.c @@ -338,7 +338,7 @@ static u32 functionality(struct i2c_adapter *adap) return I2C_FUNC_SMBUS_EMUL; } -static struct i2c_algorithm saa7134_algo = { +static const struct i2c_algorithm saa7134_algo = { .master_xfer = saa7134_i2c_xfer, .functionality = functionality, }; |