mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 17:54:13 +08:00
becf05e748
Check for iio_info structures that are only stored in the info field of a iio_dev structure. This field is declared const, so iio_info structures that have this property can be declared as const also. 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 iio_info i@p = { ... }; @ok@ identifier r.i; struct iio_dev e; position p; @@ e.info = &i@p; @bad@ position p != {r.p,ok.p}; identifier r.i; struct iio_info e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct iio_info i = { ... }; // </smpl> The result of size on this file before the change is: text data bss dec hex filename 1245 344 0 1589 635 drivers/iio/gyro/ssp_gyro_sensor.o and after the change it is: text data bss dec hex filename 1397 192 0 1589 635 drivers/iio/gyro/ssp_gyro_sensor.o Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org> |
||
---|---|---|
.. | ||
adis16080.c | ||
adis16130.c | ||
adis16136.c | ||
adis16260.c | ||
adxrs450.c | ||
bmg160_core.c | ||
bmg160_i2c.c | ||
bmg160_spi.c | ||
bmg160.h | ||
hid-sensor-gyro-3d.c | ||
itg3200_buffer.c | ||
itg3200_core.c | ||
Kconfig | ||
Makefile | ||
ssp_gyro_sensor.c | ||
st_gyro_buffer.c | ||
st_gyro_core.c | ||
st_gyro_i2c.c | ||
st_gyro_spi.c | ||
st_gyro.h |