linux/drivers/iio/light
simran singhal 3ca437c052 iio: light: apds9960: constify attribute_group structures
Check for attribute_group structures that are only stored in the
attrs filed of iio_info structure. As the attrs field of iio_info
structures is constant, so these attribute_group structures can also be
declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
struct iio_info x;
@@
x.attrs=&i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text	   data	    bss	    dec	    hex	filename
   8503	    488	      0	   8991	   231f	drivers/iio/light/apds9960.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   8567	    424	      0	   8991	   231f	drivers/iio/light/apds9960.o

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-01 11:36:22 +01:00
..
acpi-als.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
adjd_s311.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
al3320a.c iio: Add Dyna-Image AL3320A ambient light sensor driver 2014-09-10 20:25:56 +01:00
apds9300.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
apds9960.c iio: light: apds9960: constify attribute_group structures 2017-04-01 11:36:22 +01:00
bh1750.c iio: light: bh1750: constify attribute_group structures 2017-04-01 11:27:22 +01:00
bh1780.c iio: light: bh1780: assign a static name 2016-05-29 19:51:29 +01:00
cm3232.c iio: light: fix improper return value 2016-12-04 10:56:26 +00:00
cm3323.c Merge 4.2-rc3 into staging-next 2015-07-20 13:21:28 -07:00
cm3605.c iio: light: cm3605: mark PM functions as __maybe_unused 2017-01-21 12:34:54 +00:00
cm32181.c iio: Export OF module alias information in missing drivers 2015-08-02 16:36:00 +01:00
cm36651.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
cros_ec_light_prox.c iio: cros_ec_light_prox: add ChromeOS EC Light and Proximity Sensors 2017-02-04 12:29:52 +00:00
gp2ap020a00f.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
hid-sensor-als.c iio: light: hid-sensor-als: Add duplicate IIO_LIGHT channel 2016-12-30 17:06:34 +00:00
hid-sensor-prox.c hid: hid-sensor-prox: Add more data field for hysteresis parsing 2017-02-25 16:43:18 +00:00
isl29018.c staging: iio: isl29018: move out of staging 2016-10-23 19:33:56 +01:00
isl29125.c drivers:iio:light:isl29125: added macros for sensing range 2016-07-03 10:19:54 +01:00
jsa1212.c iio: light: jsa1212: remove unneeded i2c check functionality test 2016-05-21 20:18:05 +01:00
Kconfig iio:light: Add support for STMicro VL6180 sensor 2017-03-25 16:20:46 +00:00
lm3533-als.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
ltr501.c iio: light: ltr501: claim direct mode during raw writes 2016-10-23 19:34:08 +01:00
Makefile iio:light: Add support for STMicro VL6180 sensor 2017-03-25 16:20:46 +00:00
max44000.c iio: max44000: correct value in illuminance_integration_time_available 2016-12-30 20:20:23 +00:00
opt3001.c iio: light: opt3001: Export OF device ID table as module aliases 2017-01-22 13:21:29 +00:00
pa12203001.c iio: light: pa12203001: Poweroff chip if register fails 2015-11-08 15:34:40 +00:00
rpr0521.c iio: Reconcile operation order between iio_register/unregister and pm functions 2015-11-08 15:36:53 +00:00
si1145.c iio: light: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors 2016-09-18 19:56:39 +01:00
stk3310.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
tcs3414.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
tcs3472.c iio:core: timestamping clock selection support 2016-06-30 19:41:38 +01:00
tsl2563.c iio: light: tsl2563: Add OF device ID table 2017-03-19 10:52:56 +00:00
tsl2583.c iio: tsl2583: make array large enough 2016-11-24 20:09:55 +00:00
tsl4531.c iio: tsl4531: fix error handling in tsl4531_check_id() 2015-08-31 16:29:52 +01:00
us5182d.c iio: light: us5182d: Add OF device ID table 2017-03-19 10:52:03 +00:00
vcnl4000.c iio: light: vcnl4000: Add missing locking 2016-07-10 14:44:06 +01:00
veml6070.c iio: Add Vishay VEML6070 UV A light sensor driver 2016-04-19 19:58:16 +01:00
vl6180.c iio:light: Add support for STMicro VL6180 sensor 2017-03-25 16:20:46 +00:00