Re: [PATCH] ARM: PCI: Use PCI_CLASS_* defines for PCI class

From: Yijing Wang
Date: Mon Aug 25 2014 - 05:03:14 EST


On 2014/8/25 16:39, Rostislav Lisovy wrote:
> On Mon, 2014-08-04 at 11:31 +0200, Rostislav Lisovy wrote:
>> On Sun, 2014-08-03 at 09:16 -0400, Sasha Levin wrote:
>>>> - /* FIXME: add defines for class 0x68000 and 0x80103 */
>>>> if ((dev->class >> 8) == PCI_CLASS_BRIDGE_HOST ||
>>>> - dev->class == 0x68000 ||
>>>> - dev->class == 0x80103) {
>>>> + dev->class == (PCI_CLASS_BRIDGE_OTHER << 8) ||
>>>> + dev->class == ((PCI_CLASS_SYSTEM_DMA << 8) | 0x03)) {
>>>> for (i = 0; i < PCI_NUM_RESOURCES; i++) {
>>>> dev->resource[i].start = 0;
>>>> dev->resource[i].end = 0;
>>>>
>>>
>>> Care to explain how your new code is equivalent to the old one?
>>
>> The header file include/linux/pci_ids.h defines
>> #define PCI_CLASS_BRIDGE_OTHER 0x0680
>> #define PCI_CLASS_SYSTEM_DMA 0x0801
>>
>> ((struct pci_dev*)dev)->class
>> corresponds to the 3 bytes Class code in the PCI Configuration space
>> header -- 1B Base class, 1B Sub-class, 1B Reg-level interface.
>>
>> In that case
>> (PCI_CLASS_BRIDGE_OTHER << 8)
>> is equivalent to 0x68000 (imagine the leading zero)
>> and
>> ((PCI_CLASS_SYSTEM_DMA << 8) | 0x03))
>> is equivalent to 0x80103.
>>
>
> Just a kind reminder in case anyone is interested in reviewing and
> accepting the patch.

Reviewed-by : Yijing Wang <wangyijing@xxxxxxxxxx>

>
> Best regards;
> Rostislav Lisovy
>
>
>
> .
>


--
Thanks!
Yijing

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/