Re: [RFC PATCH v1 0/9] PCI/portdrv: Squash into one file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[cc += linux-pci, sorry, forgot to copy the list when first replying to
your message, I hope this is appropriate]

On Fri, Jun 08, 2018 at 04:06:39PM -0500, Bjorn Helgaas wrote:
> On Fri, Jun 8, 2018 at 3:38 PM Lukas Wunner <lukas@xxxxxxxxx> wrote:
> > On Fri, Jun 08, 2018 at 03:12:00PM -0500, Bjorn Helgaas wrote:
> > > The portdrv code is scattered across several files, which makes it a bit
> > > of a hassle to browse.  Consolidate it all in a single file.
> >
> > Why?  By that logic we could concatinate the whole kernel into a single
> > file.  The rationale of splitting into multiple files is to separate
> > distinct components.  In the case of portdrv, this means separating
> > the portion that interfaces with the PCI core (for the port's pci_dev)
> > from the portion that interfaces with the service drivers.
> 
> My experience with portdrv and AER and all the hotplug drivers is that
> I want to look at something but I don't know the exact name.  For
> example, I might want to look at the interrupt handling code.  One
> plausible way is to start up cscope, search for files "aer/aer", guess
> which file contains it, find it's wrong, try the next one, etc.  If I
> were smarter I suppose I would search for callers of request_irq() and
> grep out "aer".  But that all feels like a hassle.

"git grep" does a pretty good job for me to locate stuff like this, e.g.:

Locate request_irq in all of AER:
git grep request_irq drivers/pci/pcie/aer
(the aer directory can be omitted if you first cd into it)

Locate request_irq in all of AER in Linus' current tree:
git grep request_irq torvalds/master -- drivers/pci/pcie/aer
(assuming that the git remote of Linus' tree is named "torvalds")

Use -e if you grep for something prefixed with a dash, such as callback
invocations:
git grep -e '->reset_slot' drivers/pci

If you're in a subdirectory but would like to search the entire tree:
git grep -e '->reset_slot' :/

And so on...



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux