All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Crispin <john@phrozen.org>
To: "Anoop P.A" <anoop.pa@gmail.com>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH 2/2] Fix pci id check.
Date: Fri, 17 Aug 2012 13:26:05 +0200	[thread overview]
Message-ID: <502E2A4D.1020502@phrozen.org> (raw)
In-Reply-To: <1297779250-26798-1-git-send-email-anoop.pa@gmail.com>

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

      reply	other threads:[~2012-08-17 11:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 14:12 [PATCH 0/2] Minor improvements to MSP pci support Anoop P.A
2011-02-15 14:13 ` [PATCH 1/2] Introduce MSP_HAS_PCI config option Anoop P.A
2011-02-15 14:14 ` [PATCH 2/2] Fix pci id check Anoop P.A
2012-08-17 11:26   ` John Crispin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502E2A4D.1020502@phrozen.org \
    --to=john@phrozen.org \
    --cc=anoop.pa@gmail.com \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.