For example, when we want to find the definition of struct device in linux kernel tree,the result is:
# line filename / context / line
1 115 Documentation/lguest/lguest.c <<device>>
struct device
2 32 Documentation/spi/spidev_test.c <<device>>
static const char *device = "/dev/spidev1.1";
3 117 arch/x86/kernel/early-quirks.c <<device>>
u32 device;
4 48 arch/x86/kernel/reboot_fixups_32.c <<device>>
unsigned int device;
5 46 arch/x86/pci/irq.c <<device>>
u16 vendor, device;
6 53 arch/x86/pci/irq.c <<device>>
int (*probe)(struct irq_router *r, struct pci_dev *router, u16 device);\
......
That is because: 1) there are lots of "struct device" in header files (to avoid including headers); 2) Some locale variables with same name exists.
How can we avoid this and find the right definition quickly?
Thanks!
If you want to limit the scope of the search to just those files
included by the current source file, you may find what you're
looking for in
:help include-search
HTH,
Gary
HTH,
Gary