Skip to content

Commit

Permalink
power: supply: constify attribute_group structures.
Browse files Browse the repository at this point in the history
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   2673	    400	      0	   3073	    c01	power/supply/pcf50633-charger.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   2737	    336	      0	   3073	    bed	power/supply/pcf50633-charger.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
  • Loading branch information
ArvindYadavCs authored and sre committed Jul 24, 2017
1 parent 2f04cd2 commit 980092e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/supply/pcf50633-charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static struct attribute *pcf50633_mbc_sysfs_entries[] = {
NULL,
};

static struct attribute_group mbc_attr_group = {
static const struct attribute_group mbc_attr_group = {
.name = NULL, /* put in device directory */
.attrs = pcf50633_mbc_sysfs_entries,
};
Expand Down

0 comments on commit 980092e

Please sign in to comment.