Commit 26408b24 authored by Arvind Yadav's avatar Arvind Yadav Committed by Rafael J. Wysocki

ACPI / power: constify attribute_group structures

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
   4622	    304	      8	   4934	   1346	drivers/acpi/power.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   4846	     80	      8	   4934	   1346	drivers/acpi/power.o
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent b6aeab44
...@@ -352,7 +352,7 @@ static struct attribute *attrs[] = { ...@@ -352,7 +352,7 @@ static struct attribute *attrs[] = {
NULL, NULL,
}; };
static struct attribute_group attr_groups[] = { static const struct attribute_group attr_groups[] = {
[ACPI_STATE_D0] = { [ACPI_STATE_D0] = {
.name = "power_resources_D0", .name = "power_resources_D0",
.attrs = attrs, .attrs = attrs,
...@@ -371,14 +371,14 @@ static struct attribute_group attr_groups[] = { ...@@ -371,14 +371,14 @@ static struct attribute_group attr_groups[] = {
}, },
}; };
static struct attribute_group wakeup_attr_group = { static const struct attribute_group wakeup_attr_group = {
.name = "power_resources_wakeup", .name = "power_resources_wakeup",
.attrs = attrs, .attrs = attrs,
}; };
static void acpi_power_hide_list(struct acpi_device *adev, static void acpi_power_hide_list(struct acpi_device *adev,
struct list_head *resources, struct list_head *resources,
struct attribute_group *attr_group) const struct attribute_group *attr_group)
{ {
struct acpi_power_resource_entry *entry; struct acpi_power_resource_entry *entry;
...@@ -397,7 +397,7 @@ static void acpi_power_hide_list(struct acpi_device *adev, ...@@ -397,7 +397,7 @@ static void acpi_power_hide_list(struct acpi_device *adev,
static void acpi_power_expose_list(struct acpi_device *adev, static void acpi_power_expose_list(struct acpi_device *adev,
struct list_head *resources, struct list_head *resources,
struct attribute_group *attr_group) const struct attribute_group *attr_group)
{ {
struct acpi_power_resource_entry *entry; struct acpi_power_resource_entry *entry;
int ret; int ret;
...@@ -425,7 +425,7 @@ static void acpi_power_expose_list(struct acpi_device *adev, ...@@ -425,7 +425,7 @@ static void acpi_power_expose_list(struct acpi_device *adev,
static void acpi_power_expose_hide(struct acpi_device *adev, static void acpi_power_expose_hide(struct acpi_device *adev,
struct list_head *resources, struct list_head *resources,
struct attribute_group *attr_group, const struct attribute_group *attr_group,
bool expose) bool expose)
{ {
if (expose) if (expose)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment