]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: Make PCI device ids constant
authorMárton Németh <nm127@freemail.hu>
Sun, 10 Jan 2010 19:52:35 +0000 (20:52 +0100)
committerJean Delvare <khali@linux-fr.org>
Sun, 10 Jan 2010 19:52:35 +0000 (20:52 +0100)
commit2c5362350c381c8f0064d1b2dba5b2101d38c8cd
tree3dcc7bd17a057db82055c5c04eca51bca863cffd
parent5f1a101827080c1bd5d772f8d9a89fb12269d4a7
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>
drivers/hwmon/k10temp.c
drivers/hwmon/k8temp.c
drivers/hwmon/sis5595.c
drivers/hwmon/via686a.c
drivers/hwmon/vt8231.c