linux/drivers/hid/usbhid
Márton Németh d67dec5b2c HID: make USB device id constant
The id_table field of the struct usb_device_id is constant in <linux/usb.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: Jiri Kosina <jkosina@suse.cz>
2010-01-12 14:34:43 +01:00
..
hid-core.c HID: make USB device id constant 2010-01-12 14:34:43 +01:00
hid-pidff.c HID: pidff - fix unnecessary loop iterations on reset 2009-11-04 10:04:08 +01:00
hid-quirks.c Merge branches 'bkl-removal', 'upstream' and 'upstream-fixes' into for-linus 2009-12-07 18:30:49 +01:00
hiddev.c HID: remove BKL from hiddev_ioctl_usage() 2009-11-05 18:59:03 +01:00
Kconfig HID: make boot protocol drivers depend on EMBEDDED 2009-01-04 01:00:53 +01:00
Makefile HID: remove hid-ff 2008-10-14 23:51:01 +02:00
usbhid.h HID: autosuspend support for USB HID 2009-03-25 17:57:57 +01:00
usbkbd.c Input: do not overwrite the first part of phys string 2009-11-23 08:50:52 -08:00
usbmouse.c HID: remove info() macro from usb HID drivers 2008-10-14 23:51:03 +02:00