lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 4 Mar 2012 23:17:04 +0100 (CET)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	Dan Carpenter <dan.carpenter@...cle.com>
cc:	Lionel Debroux <lionel_debroux@...oo.fr>,
	linux-kernel@...r.kernel.org, linux-edac@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] edac: move const pci_device_id tables from __devinitdata
 to __devinitconst.

I also looked at whether PCI_DEVICE and PCI_DEVICE_CLASS could be used 
more often, and came up with the semantic patch shown below.  This should 
work with the current release of Coccinelle.  This affects 40 files, only 
one of which can use PCI_DEVICE_CLASS.  Perhaps it could be useful to 
generalize it.  Again, I don't have time now to look into it in more 
detail, but can provide the results if somone is interested.

julia

@@
identifier id;
expression dev_class, dev_class_mask;
@@

struct pci_device_id id[] = {
   ...,
   {
-   .class = (dev_class), .class_mask = (dev_class_mask),
-   .vendor = PCI_ANY_ID, .device = PCI_ANY_ID,
-   .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
+   PCI_DEVICE_CLASS(dev_class,dev_class_mask),
   },
   ...
};

@@
identifier id;
declarer name DEFINE_PCI_DEVICE_TABLE;
expression dev_class, dev_class_mask;
@@

DEFINE_PCI_DEVICE_TABLE(id) = {
   ...,
   {
-   .class = (dev_class), .class_mask = (dev_class_mask),
-   .vendor = PCI_ANY_ID, .device = PCI_ANY_ID,
-   .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
+   PCI_DEVICE_CLASS(dev_class,dev_class_mask),
   },
   ...
};

@@
identifier id;
expression vend, dev;
@@

struct pci_device_id id[] = {
   ...,
   {
-   .vendor = (vend), .device = (dev),
-   .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
+   PCI_DEVICE(vend,dev),
   },
   ...
};

@@
identifier id;
expression vend, dev;
@@

DEFINE_PCI_DEVICE_TABLE(id) = {
   ...,
   {
-   .vendor = (vend), .device = (dev),
-   .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
+   PCI_DEVICE(vend,dev),
   },
   ...
};
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ