linux-mips
[Top] [All Lists]

Re: [PATCH 2/2] Fix pci id check.

To: "Anoop P.A" <anoop.pa@gmail.com>
Subject: Re: [PATCH 2/2] Fix pci id check.
From: John Crispin <john@phrozen.org>
Date: Fri, 17 Aug 2012 13:26:05 +0200
Cc: linux-mips@linux-mips.org
In-reply-to: <1297779250-26798-1-git-send-email-anoop.pa@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1297779151-26595-1-git-send-email-anoop.pa@gmail.com> <1297779250-26798-1-git-send-email-anoop.pa@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16
Hi Anoop,

> -#define MSP_HAS_PCI(ID)      (((u32)(ID) <= 0x4236) && ((u32)(ID) >= 0x4220))
> +#define MSP_HAS_PCI(ID)  ((((u32)(ID) <= (0x4236)) && \
> +                     ((u32)(ID) >= (0x4220))) || \
> +                     ((u32)(ID) == (0x7140)))
> +#define MSP_PCI_READ_REG32(base, byte_offset) \
> +     (*((volatile u32 *)((u8 *)(base) + (byte_offset))))

why not use __raw_readl() ?

>       /* Extract Device ID */
> -     id = read_reg32(PCI_JTAG_DEVID_REG, 0xFFFF) >> 12;
> +     id = (MSP_PCI_READ_REG32(PCI_JTAG_DEVID_REG, 0) >> 12) & 0x0FFFF;

You can simplify the macro above as byte_offset == 0 ... do we even need
a macro as there is only one user of it ... ?

John


<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH 2/2] Fix pci id check., John Crispin <=