diff options
author | Thomas Renninger <trenn@suse.de> | 2010-10-01 04:54:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-10-01 19:28:51 -0400 |
commit | 620e112cfe1c9281c176de8ad1a7691c4eb4950d (patch) | |
tree | b7a2b5b389396ac1b90f7d586af568044df7804f | |
parent | 2b2ae7c7f8e25043793042eb9df88aa875b4cff8 (diff) |
ACPI/PNP: A HID value of an object never changes -> make it const
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/acpi/button.c | 4 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 5 | ||||
-rw-r--r-- | drivers/pnp/base.h | 5 | ||||
-rw-r--r-- | drivers/pnp/core.c | 3 | ||||
-rw-r--r-- | drivers/pnp/driver.c | 2 | ||||
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 2 | ||||
-rw-r--r-- | include/acpi/acpi_bus.h | 2 |
7 files changed, 12 insertions, 11 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 1575a9b51f1d..71ef9cd0735f 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -338,7 +338,8 @@ static int acpi_button_add(struct acpi_device *device) | |||
338 | { | 338 | { |
339 | struct acpi_button *button; | 339 | struct acpi_button *button; |
340 | struct input_dev *input; | 340 | struct input_dev *input; |
341 | char *hid, *name, *class; | 341 | const char *hid = acpi_device_hid(device); |
342 | char *name, *class; | ||
342 | int error; | 343 | int error; |
343 | 344 | ||
344 | button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL); | 345 | button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL); |
@@ -353,7 +354,6 @@ static int acpi_button_add(struct acpi_device *device) | |||
353 | goto err_free_button; | 354 | goto err_free_button; |
354 | } | 355 | } |
355 | 356 | ||
356 | hid = acpi_device_hid(device); | ||
357 | name = acpi_device_name(device); | 357 | name = acpi_device_name(device); |
358 | class = acpi_device_class(device); | 358 | class = acpi_device_class(device); |
359 | 359 | ||
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 81aec8d66fd0..6155eeb2e89a 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -26,8 +26,7 @@ extern struct acpi_device *acpi_root; | |||
26 | 26 | ||
27 | #define ACPI_IS_ROOT_DEVICE(device) (!(device)->parent) | 27 | #define ACPI_IS_ROOT_DEVICE(device) (!(device)->parent) |
28 | 28 | ||
29 | /* Should be const */ | 29 | static const char *dummy_hid = "device"; |
30 | static char* dummy_hid = "device"; | ||
31 | 30 | ||
32 | static LIST_HEAD(acpi_device_list); | 31 | static LIST_HEAD(acpi_device_list); |
33 | static LIST_HEAD(acpi_bus_id_list); | 32 | static LIST_HEAD(acpi_bus_id_list); |
@@ -1021,7 +1020,7 @@ static int acpi_dock_match(struct acpi_device *device) | |||
1021 | return acpi_get_handle(device->handle, "_DCK", &tmp); | 1020 | return acpi_get_handle(device->handle, "_DCK", &tmp); |
1022 | } | 1021 | } |
1023 | 1022 | ||
1024 | char *acpi_device_hid(struct acpi_device *device) | 1023 | const char *acpi_device_hid(struct acpi_device *device) |
1025 | { | 1024 | { |
1026 | struct acpi_hardware_id *hid; | 1025 | struct acpi_hardware_id *hid; |
1027 | 1026 | ||
diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h index 0bab84ebb15d..19bc73695475 100644 --- a/drivers/pnp/base.h +++ b/drivers/pnp/base.h | |||
@@ -12,11 +12,12 @@ void pnp_unregister_protocol(struct pnp_protocol *protocol); | |||
12 | 12 | ||
13 | #define PNP_EISA_ID_MASK 0x7fffffff | 13 | #define PNP_EISA_ID_MASK 0x7fffffff |
14 | void pnp_eisa_id_to_string(u32 id, char *str); | 14 | void pnp_eisa_id_to_string(u32 id, char *str); |
15 | struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *, int id, char *pnpid); | 15 | struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *, int id, |
16 | const char *pnpid); | ||
16 | struct pnp_card *pnp_alloc_card(struct pnp_protocol *, int id, char *pnpid); | 17 | struct pnp_card *pnp_alloc_card(struct pnp_protocol *, int id, char *pnpid); |
17 | 18 | ||
18 | int pnp_add_device(struct pnp_dev *dev); | 19 | int pnp_add_device(struct pnp_dev *dev); |
19 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id); | 20 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id); |
20 | 21 | ||
21 | int pnp_add_card(struct pnp_card *card); | 22 | int pnp_add_card(struct pnp_card *card); |
22 | void pnp_remove_card(struct pnp_card *card); | 23 | void pnp_remove_card(struct pnp_card *card); |
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index 88b3cde52596..c79ee1ded68d 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c | |||
@@ -124,7 +124,8 @@ static void pnp_release_device(struct device *dmdev) | |||
124 | kfree(dev); | 124 | kfree(dev); |
125 | } | 125 | } |
126 | 126 | ||
127 | struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, char *pnpid) | 127 | struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, |
128 | const char *pnpid) | ||
128 | { | 129 | { |
129 | struct pnp_dev *dev; | 130 | struct pnp_dev *dev; |
130 | struct pnp_id *dev_id; | 131 | struct pnp_id *dev_id; |
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index cd11b113494f..d1dbb9df53fa 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c | |||
@@ -236,7 +236,7 @@ void pnp_unregister_driver(struct pnp_driver *drv) | |||
236 | * @dev: pointer to the desired device | 236 | * @dev: pointer to the desired device |
237 | * @id: pointer to an EISA id string | 237 | * @id: pointer to an EISA id string |
238 | */ | 238 | */ |
239 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id) | 239 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id) |
240 | { | 240 | { |
241 | struct pnp_id *dev_id, *ptr; | 241 | struct pnp_id *dev_id, *ptr; |
242 | 242 | ||
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index dc4e32e031e9..4aafcf89b03b 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -59,7 +59,7 @@ static inline int __init is_exclusive_device(struct acpi_device *dev) | |||
59 | #define TEST_ALPHA(c) \ | 59 | #define TEST_ALPHA(c) \ |
60 | if (!('@' <= (c) || (c) <= 'Z')) \ | 60 | if (!('@' <= (c) || (c) <= 'Z')) \ |
61 | return 0 | 61 | return 0 |
62 | static int __init ispnpidacpi(char *id) | 62 | static int __init ispnpidacpi(const char *id) |
63 | { | 63 | { |
64 | TEST_ALPHA(id[0]); | 64 | TEST_ALPHA(id[0]); |
65 | TEST_ALPHA(id[1]); | 65 | TEST_ALPHA(id[1]); |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 4de84ce3a927..a47bb908ddcd 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -184,7 +184,7 @@ struct acpi_device_pnp { | |||
184 | 184 | ||
185 | #define acpi_device_bid(d) ((d)->pnp.bus_id) | 185 | #define acpi_device_bid(d) ((d)->pnp.bus_id) |
186 | #define acpi_device_adr(d) ((d)->pnp.bus_address) | 186 | #define acpi_device_adr(d) ((d)->pnp.bus_address) |
187 | char *acpi_device_hid(struct acpi_device *device); | 187 | const char *acpi_device_hid(struct acpi_device *device); |
188 | #define acpi_device_name(d) ((d)->pnp.device_name) | 188 | #define acpi_device_name(d) ((d)->pnp.device_name) |
189 | #define acpi_device_class(d) ((d)->pnp.device_class) | 189 | #define acpi_device_class(d) ((d)->pnp.device_class) |
190 | 190 | ||