diff options
author | Márton Németh <nm127@freemail.hu> | 2010-01-10 14:52:35 -0500 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2010-01-10 14:52:35 -0500 |
commit | 3dd3a156355e7e6bec0dc9a0bbb6eeecbd965d50 (patch) | |
tree | 3dcc7bd17a057db82055c5c04eca51bca863cffd /drivers/hwmon/k8temp.c | |
parent | 1fe63ab47a617ee95f562eaa7ddbbc59981ff8c6 (diff) |
hwmon: Make PCI device ids constant
The id_table field of the struct pci_driver is constant in <linux/pci.h>
so it is worth to make pci_device_id also constant.
The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r@
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>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/k8temp.c')
-rw-r--r-- | drivers/hwmon/k8temp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c index 1fe995111841..0ceb6d6200a3 100644 --- a/drivers/hwmon/k8temp.c +++ b/drivers/hwmon/k8temp.c | |||
@@ -136,7 +136,7 @@ static SENSOR_DEVICE_ATTR_2(temp3_input, S_IRUGO, show_temp, NULL, 1, 0); | |||
136 | static SENSOR_DEVICE_ATTR_2(temp4_input, S_IRUGO, show_temp, NULL, 1, 1); | 136 | static SENSOR_DEVICE_ATTR_2(temp4_input, S_IRUGO, show_temp, NULL, 1, 1); |
137 | static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); | 137 | static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); |
138 | 138 | ||
139 | static struct pci_device_id k8temp_ids[] = { | 139 | static const struct pci_device_id k8temp_ids[] = { |
140 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MISC) }, | 140 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MISC) }, |
141 | { 0 }, | 141 | { 0 }, |
142 | }; | 142 | }; |