From: Yinghai Lu <yinghai@kernel.org>
To: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
linux-arch@vger.kernel.org, torvalds@linux-foundation.org,
Bjorn Helgaas <bjorn.helgaas@hp.com>,
Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: Re: [PATCH 1/2] resource: align functions now return start of resource
Date: Fri, 1 Jan 2010 14:12:09 -0800 [thread overview]
Message-ID: <86802c441001011412u1543c1afk6337cd6d3ea0f257@mail.gmail.com> (raw)
In-Reply-To: <1262364050-8540-1-git-send-email-linux@dominikbrodowski.net>
On Fri, Jan 1, 2010 at 8:40 AM, Dominik Brodowski
<linux@dominikbrodowski.net> wrote:
> As suggested by Linus, align functions should return the start
> of a resource, not void. An update of "res->start" is no longer
> necessary.
>
> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
> Cc: Yinghai Lu <yhlu.kernel@gmail.com>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> ---
> arch/alpha/kernel/pci.c | 4 ++--
> arch/arm/kernel/bios32.c | 8 +++++---
> arch/cris/arch-v32/drivers/pci/bios.c | 14 ++++++--------
> arch/frv/mb93090-mb00/pci-frv.c | 14 ++++++--------
> arch/ia64/pci/pci.c | 3 ++-
> arch/mips/pci/pci.c | 4 ++--
> arch/mips/pmc-sierra/yosemite/ht.c | 10 +++++-----
> arch/mn10300/unit-asb2305/pci-asb2305.c | 16 +++++++---------
> arch/parisc/kernel/pci.c | 10 +++++-----
> arch/powerpc/kernel/pci-common.c | 13 ++++++-------
> arch/sh/drivers/pci/pci.c | 6 +++---
> arch/sparc/kernel/pci.c | 5 +++--
> arch/sparc/kernel/pcic.c | 5 +++--
> arch/x86/pci/i386.c | 12 +++++-------
> arch/xtensa/kernel/pci.c | 11 +++++------
> drivers/pci/bus.c | 6 ++++--
> drivers/pcmcia/rsrc_mgr.c | 12 ++++++------
> drivers/pcmcia/rsrc_nonstatic.c | 16 +++++++++-------
> include/linux/ioport.h | 6 ++++--
> include/linux/pci.h | 8 +++++---
> kernel/resource.c | 14 +++++++++-----
> 21 files changed, 102 insertions(+), 95 deletions(-)
>
> diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
> index a91ba28..5cf111e 100644
> --- a/arch/alpha/kernel/pci.c
> +++ b/arch/alpha/kernel/pci.c
> @@ -126,7 +126,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final);
> #define MB (1024*KB)
> #define GB (1024*MB)
>
> -void
> +resource_size_t
> pcibios_align_resource(void *data, struct resource *res,
> resource_size_t size, resource_size_t align)
> {
> @@ -184,7 +184,7 @@ pcibios_align_resource(void *data, struct resource *res,
> }
> }
>
> - res->start = start;
> + return start;
> }
> #undef KB
> #undef MB
> diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
> index 8096819..a7c85f8 100644
> --- a/arch/arm/kernel/bios32.c
> +++ b/arch/arm/kernel/bios32.c
> @@ -616,15 +616,17 @@ char * __init pcibios_setup(char *str)
> * but we want to try to avoid allocating at 0x2900-0x2bff
> * which might be mirrored at 0x0100-0x03ff..
> */
> -void pcibios_align_resource(void *data, struct resource *res,
> - resource_size_t size, resource_size_t align)
> +resource_size_t pcibios_align_resource(void *data, struct resource *res,
> + resource_size_t size, resource_size_t align)
> {
> resource_size_t start = res->start;
>
> if (res->flags & IORESOURCE_IO && start & 0x300)
> start = (start + 0x3ff) & ~0x3ff;
>
> - res->start = (start + align - 1) & ~(align - 1);
> + start = (start + align - 1) & ~(align - 1);
> +
> + return start;
> }
>
> /**
> diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c
> index 77ee319..5811e2f 100644
> --- a/arch/cris/arch-v32/drivers/pci/bios.c
> +++ b/arch/cris/arch-v32/drivers/pci/bios.c
> @@ -41,18 +41,16 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
> return 0;
> }
>
> -void
> +resource_size_t
> pcibios_align_resource(void *data, struct resource *res,
> resource_size_t size, resource_size_t align)
> {
> - if (res->flags & IORESOURCE_IO) {
> - resource_size_t start = res->start;
> + resource_size_t start = res->start;
>
> - if (start & 0x300) {
> - start = (start + 0x3ff) & ~0x3ff;
> - res->start = start;
> - }
> - }
> + if ((res->flags & IORESOURCE_IO) && (start & 0x300))
> + start = (start + 0x3ff) & ~0x3ff;
> +
> + return start
missed ; here?
YH
next prev parent reply other threads:[~2010-01-01 22:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20091220095001.GA6029@comet.dominikbrodowski.net>
[not found] ` <alpine.LFD.2.00.0912201026570.3712@localhost.localdomain>
[not found] ` <20091221084031.GB1648@isilmar.linta.de>
[not found] ` <alpine.LFD.2.00.0912210801260.21722@localhost.localdomain>
2010-01-01 16:38 ` [RFC] improve alignf() calling convention in allocate_resource() Dominik Brodowski
2010-01-01 16:38 ` Dominik Brodowski
2010-01-01 16:40 ` [PATCH 1/2] resource: align functions now return start of resource Dominik Brodowski
2010-01-01 16:40 ` Dominik Brodowski
2010-01-01 22:12 ` Yinghai Lu [this message]
2010-01-03 16:30 ` Dominik Brodowski
2010-01-03 16:30 ` Dominik Brodowski
2010-01-15 18:23 ` Jesse Barnes
2010-01-15 18:23 ` Jesse Barnes
2010-01-01 16:40 ` [PATCH 2/2] resource: mark struct resource as const Dominik Brodowski
2010-01-01 16:40 ` Dominik Brodowski
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=86802c441001011412u1543c1afk6337cd6d3ea0f257@mail.gmail.com \
--to=yinghai@kernel.org \
--cc=bjorn.helgaas@hp.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).