diff options
author | Márton Németh <nm127@freemail.hu> | 2010-01-10 17:15:36 +0100 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-01-16 21:56:43 +0100 |
commit | c97adf9e7bebf17a86b95e2131bf9ba76c4857c7 (patch) | |
tree | 11667422c8b8a8d9f2980affd5f74611c4d12724 /drivers/acpi/power_meter.c | |
parent | sony-laptop - fix using of uninitialized variable (diff) | |
download | linux-c97adf9e7bebf17a86b95e2131bf9ba76c4857c7.tar.xz linux-c97adf9e7bebf17a86b95e2131bf9ba76c4857c7.zip |
acpi: make ACPI device id constant
The ids field of the struct acpi_driver is constant in <linux/acpi/acpi_bus.h>
so it is worth to make the initialization data also constant.
The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
...
const struct I2 *x;
...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
.x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+ const
struct I2 E[] = ...;
// </smpl>
Signed-off-by: Márton Németh <nm127@freemail.hu>
Cc: Julia Lawall <julia@diku.dk>
Cc: cocci@diku.dk
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/power_meter.c')
-rw-r--r-- | drivers/acpi/power_meter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/power_meter.c b/drivers/acpi/power_meter.c index 2ef7030a0c28..ca75c36f754c 100644 --- a/drivers/acpi/power_meter.c +++ b/drivers/acpi/power_meter.c @@ -64,7 +64,7 @@ static int can_cap_in_hardware(void) return force_cap_on || cap_in_hardware; } -static struct acpi_device_id power_meter_ids[] = { +static const struct acpi_device_id power_meter_ids[] = { {"ACPI000D", 0}, {"", 0}, }; |