diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2016-09-29 20:28:31 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-02 17:24:00 +0200 |
commit | d983c597757883496a9e4956e308395f8ac53bf0 (patch) | |
tree | a7e446cc3f456c610c70516d7dbdb7d382f24616 /drivers/staging/most | |
parent | 4ee4b9da2b01421521f6ee434e7d6098aecedbdf (diff) | |
download | linux-d983c597757883496a9e4956e308395f8ac53bf0.tar.bz2 |
Staging: most: hdm-dim2: 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,e2;
@@
(
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
509 160 0 669 29d
drivers/staging/most/hdm-dim2/dim2_sysfs.o
File size after:
text data bss dec hex filename
565 96 0 661 295
drivers/staging/most/hdm-dim2/dim2_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>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r-- | drivers/staging/most/hdm-dim2/dim2_sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/most/hdm-dim2/dim2_sysfs.c b/drivers/staging/most/hdm-dim2/dim2_sysfs.c index 2b28e4a51131..d8b22f91d2c3 100644 --- a/drivers/staging/most/hdm-dim2/dim2_sysfs.c +++ b/drivers/staging/most/hdm-dim2/dim2_sysfs.c @@ -39,7 +39,7 @@ static struct attribute *bus_default_attrs[] = { NULL, }; -static struct attribute_group bus_attr_group = { +static const struct attribute_group bus_attr_group = { .attrs = bus_default_attrs, }; |