Re: [PATCH] PCI: ftpci100: rename macro name collision

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

 



On 5/17/21 3:34 AM, Krzysztof Wilczyński wrote:
> Hi Randy and Linus,
> 
> [...]
>>> PCI_IOSIZE is defined in mach-loongson64/spaces.h, so change the name
>>> of this macro in pci-ftpci100.c.
> [...]
>> Though I suspect the real solution is to prefix all macros with FTPCI_*?

I'm willing to go that far.

> Agreed, especially since some of the constants and macros in this
> driver already prefix various names using "FARADAY_".  We could keep
> this pattern and apply this prefix to other things.  There are also
> other constants and macros named starting with "PCI_" that could
> potentially be renamed too.
> 
> Having said that, I actually wonder if some of these constants and
> macros are would be something we already have declared (people tend to
> often solve the same problems)and could be reused, as per:
> 
>   #define PCI_IOSIZE	0x00
>   #define PCI_PROT	0x04 /* AHB protection */
>   #define PCI_CTRL	0x08 /* PCI control signal */
>   #define PCI_SOFTRST	0x10 /* Soft reset counter and response error enable */
>   #define PCI_CONFIG	0x28 /* PCI configuration command register */
>   #define PCI_DATA	0x2C
> 
> Or these:
> 
>   #define PCI_CONF_ENABLE	BIT(31)
>   #define PCI_CONF_WHERE(r)	((r) & 0xFC)
>   #define PCI_CONF_BUS(b)	(((b) & 0xFF) << 16)
>   #define PCI_CONF_DEVICE(d)	(((d) & 0x1F) << 11)
>   #define PCI_CONF_FUNCTION(f)	(((f) & 0x07) << 8)


If you would like to take that and run with it, please go ahead.

thanks.
-- 
~Randy




[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