linux/drivers/staging
Bhumika Goyal 7b346dac73 Staging: dgnc: constify attribute_group structures
Check for attribute_group structures that are only passed as a second
argument to the functions sysfs_remove_group and sysfs_create_group. As
these arguments are constant so, attribute_group structures having this
property  can also be made constant.
Done using coccinelle:

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

@ok1@
identifier r1.i;
position p;
expression e1;
@@
(
sysfs_remove_group(e1,&i@p)
|
sysfs_create_group(e1,&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
   6248	   1024	      0	   7272	   1c68
drivers/staging/dgnc/dgnc_sysfs.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   6288	    960	      0	   7248	   1c50
drivers/staging/dgnc/dgnc_sysfs.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-02 17:24:00 +02:00
..
android staging: android: ion: fix checks found by checkpatch.pl 2016-10-02 16:58:29 +02:00
board staging: board: line over 80 characters 2016-04-29 17:58:02 -07:00
clocking-wizard
comedi staging: comedi: Use vma_pages function on vma object instead of explicit computation 2016-09-20 14:01:21 +02:00
dgnc Staging: dgnc: constify attribute_group structures 2016-10-02 17:24:00 +02:00
emxx_udc staging: emxx_udc: add braces to if-else block 2016-09-16 10:10:34 +02:00
fbtft staging: fbtft: fix NULL comparison checkpatch warning 2016-10-02 17:18:38 +02:00
fsl-mc Staging: fsl-mc: Use !x instead of x == NULL. 2016-09-20 13:52:51 +02:00
fwserial staging: fwserial: fix checkpatch permission warnings 2016-09-13 15:44:46 +02:00
gdm724x staging: gdm724x: Remove unnecessary blank line 2016-09-16 10:10:34 +02:00
goldfish
greybus staging: greybus: light: check the correct value of delay_on 2016-10-02 15:49:26 +02:00
gs_fpgaboot staging: gs_fpgaboot: Remove FSF address from GPL notice 2016-09-16 10:10:34 +02:00
i4l staging: i4l: act2000: Move assignment out of if statement 2016-09-20 13:46:32 +02:00
iio Staging: iio: light: constify attribute_group structures 2016-09-27 13:03:57 +02:00
ks7010 staging: ks7010: declare private functions static 2016-09-28 11:33:52 +02:00
lustre staging: lustre: llite: add missing LMV_MAGIC_V1 case 2016-09-27 13:01:21 +02:00
media staging: media: replace unsigned with unsigned int 2016-10-02 16:57:47 +02:00
most Staging: most: hdm-dim2: constify attribute_group structures 2016-10-02 17:24:00 +02:00
mt29f_spinand staging: mt29f_spinand: set ECC algorithm explicitly 2016-05-05 23:52:04 +02:00
netlogic Staging: netlogic: Remove unused function 2016-09-16 10:10:34 +02:00
nvec
octeon Staging: octeon: Add missing of_node_put after calling of_parse_phandle. 2016-09-20 13:51:24 +02:00
octeon-usb staging: octeon-usb: Remove unnecessary assignment 2016-09-22 11:54:48 +02:00
olpc_dcon Revert "staging: olpc_dcon: Replace a bit shift by a use of BIT." 2016-09-18 13:09:50 +02:00
rtl8188eu staging: rtl8188eu: core: rtw_security: Remove return statement from void function 2016-09-25 12:42:35 +02:00
rtl8192e staging: rtl8192e: fixed use a blank line after function/struct/union/enum declarations 2016-09-28 11:39:10 +02:00
rtl8192u staging: rtl8192u: remove unused functions in r8192U_core.c 2016-09-23 19:00:44 +02:00
rtl8712 staging: rtl8712: Change _LED_STATE enum in rtl871x driver to avoid conflicts with LED namespace 2016-09-28 11:36:45 +02:00
rts5208 Staging: rts5208: Fix indentation warnings 2016-10-02 17:14:03 +02:00
skein staging: skein: cleanup: align code to parentheses 2016-05-03 14:07:11 -07:00
slicoss staging: slicoss: cleaning up codestyle warnings 2016-09-27 13:08:04 +02:00
sm750fb staging: sm750fb: replace roundedDiv with DIV_ROUND_CLOSEST 2016-10-02 16:52:46 +02:00
speakup Staging: speakup: constify attribute_group structures 2016-10-02 17:14:03 +02:00
unisys staging: unisys: visorbus: fix typos with client_bus_info /sys entry 2016-09-28 11:30:52 +02:00
vc04_services staging: add bcm2708 vchiq driver 2016-10-02 15:40:04 +02:00
vme drivers: staging: vme: convert to octal notation for permission bits 2016-09-17 23:36:53 +02:00
vt6655 Staging: vt6655: baseband: Remove unnecessary space after a cast 2016-09-20 13:59:46 +02:00
vt6656 staging: vt6656: Remove unused variable 'rx_sts' 2016-09-28 11:35:52 +02:00
wilc1000 staging: wilc1000: remove unnecessary braces 2016-10-02 17:19:51 +02:00
wlan-ng staging: wlang-ng: Fix block comments style warnings in hfa384x.h 2016-10-02 17:06:21 +02:00
xgifb staging: xgifb: Remove unused variable and if statement 2016-09-22 11:54:47 +02:00
Kconfig staging: add bcm2708 vchiq driver 2016-10-02 15:40:04 +02:00
Makefile staging: add bcm2708 vchiq driver 2016-10-02 15:40:04 +02:00