mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@debian.org>
To: Brian Gerst <bgerst@didntduck.org>
Cc: Matthew Wilcox <willy@debian.org>,
	Sundarapandian Durairaj <sundarapandian.durairaj@intel.com>,
	Greg KH <greg@kroah.com>, Andrew Morton <akpm@zip.com.au>,
	linux-pci@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Expanded PCI config space (against 2.6.3-rc4)
Date: Wed, 18 Feb 2004 16:27:44 +0000	[thread overview]
Message-ID: <20040218162744.GL11824@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <40338F51.1030502@didntduck.org>

On Wed, Feb 18, 2004 at 11:14:09AM -0500, Brian Gerst wrote:
> Matthew Wilcox wrote:
> >@@ -55,8 +55,11 @@ struct pci_fixup pcibios_fixups[1];
> > 
> > #define PCI_SAL_ADDRESS(seg, bus, devfn, reg) \
> > 	((u64)(seg << 24) | (u64)(bus << 16) | \
> >-	 (u64)(devfn << 8) | (u64)(reg))
> >+	 (u64)(devfn << 8) | (u64)(reg)), 0
> > 
> >+#define PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg) \
> >+	((u64)(seg << 28) | (u64)(bus << 20) | \
> >+	 (u64)(devfn << 12) | (u64)(reg)), 1
> > 
> > static int
> > pci_sal_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
> >
> > 
> >-	result = ia64_sal_pci_config_read(PCI_SAL_ADDRESS(seg, bus, devfn, 
> >reg), len, &data);
> >+	if ((seg < 256) && (reg < 256)) {
> >+		result = ia64_sal_pci_config_read(PCI_SAL_ADDRESS(seg, bus, 
> >devfn, reg), len, &data);
> >+	} else {
> >+		result = ia64_sal_pci_config_read(PCI_SAL_EXT_ADDRESS(seg, 
> >bus, devfn, reg), len, &data);
> >+	}
> > 
> 
> Having PCI_SAL_*ADDRESS() return 2 values is counter-intuituitive, since 
> it looks like a normal function call.  Just add the type flag to the 
> ia64_sal_pci_config_* call directly.

um, it doesn't look like a normal function call.  it looks like a
macro because it's all in upper case.  if this were in a header file
or used more generally, i'd agree with you.  but it's not, it's just a
convenience macro used in 4 places in this one file.

besides, i got this wrong the first time, and combining it all into the
one macro doesn't let me get it wrong.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

      reply	other threads:[~2004-02-18 16:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-17 16:37 Matthew Wilcox
2004-02-18 14:21 ` Matthew Wilcox
2004-02-18 16:14   ` Brian Gerst
2004-02-18 16:27     ` Matthew Wilcox [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=20040218162744.GL11824@parcelfarce.linux.theplanet.co.uk \
    --to=willy@debian.org \
    --cc=akpm@zip.com.au \
    --cc=bgerst@didntduck.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=sundarapandian.durairaj@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®