Debian Codegraph @

demos/sgrep/device_id.sgrep

raw
1 // from LKN book de greg
2
3 // in fact search more specifically in initializer zone for
4 // the string 157e for the usb, and for the macro which
5 // is bound to 0x8139 for the pci
6
7 // could functorize/parametrize this script to be generic
8 // to handle any kind of device_id number
9
10 --- include/linux/pci_ids.h
11 +++ include/linux/pci_ids.h
12
13 // would like a $VAL passed to sgrep via a -DVAL=0x8139
14 #define V 0x8139
15
16 ---
17 +++
18
19 @@
20 identifier X;
21 @@
22
23 struct
24 (
25 pci_device_id
26 |
27 usb_device_id
28 )
29 X[] =
30 - { ... };
31
32 // would like a
33 // {
34 // <...
35 - V // en fait voudrait toute la ligne
36 ...>
37 // }