Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 92d2bfb5a363004a8a399eefe5c79f14 > files > 140

coccinelle-examples-1.0.0-0.rc4.2.fc16.i686.rpm

// from LKN book de greg

// in fact search more specifically in initializer zone for 
// the string 157e for the usb, and for the macro which
// is bound to 0x8139 for the pci

// could functorize/parametrize this script to be generic
// to handle any kind of device_id number

--- include/linux/pci_ids.h
+++ include/linux/pci_ids.h

// would like a $VAL passed to sgrep via a -DVAL=0x8139
#define V 0x8139 

---
+++

@@
identifier X;
@@

struct 
(
pci_device_id 
|
usb_device_id 
)
    X[] = 
- { ... };        

// would like a 
// { 
// <... 
- V  // en fait voudrait toute la ligne
 ...>
// }