Re: [PATCH v3 04/23] staging: mt7621-pci: reimplement pci_config_[read|write] functions

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

 



On Mon, Jul 09, 2018 at 10:21:06PM +0200, Sergio Paracuellos wrote:
> The logic for this functions is kind of mess calling to other
> functions which ends up in using very ugly macros. Reimplement
> this two using kernel write[b,w,l] and read[b,w,l] and the variable
> 'mt7621_pci_base'. Function prototypes have changed style to avoid
> long lines.
> 
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@xxxxxxxxx>
> ---
>  drivers/staging/mt7621-pci/pci-mt7621.c | 54 +++++++++++++++++++++++++++------
>  1 file changed, 44 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
> index b745423..122c046 100644
> --- a/drivers/staging/mt7621-pci/pci-mt7621.c
> +++ b/drivers/staging/mt7621-pci/pci-mt7621.c
> @@ -273,29 +273,63 @@ write_config_dword(struct pci_bus *bus, unsigned int devfn, int where, u32 val)
>  }
>  
>  static int
> -pci_config_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
> +pci_config_read(struct pci_bus *bus, unsigned int devfn,
> +		int where, int size, u32 *val)

I love it how drivers think they need to duplcate functions that the pci
core provides you already.

{sigh}

Why is this even needed?  Why can't the pci functions be used instead?
This 'hand-rolled' function is just horrid, even after you have tried to
fix it up.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux