All of lore.kernel.org
 help / color / mirror / Atom feed
From: jamie@jamieiles.com (Jamie Iles)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/9] orion: make __arch_ioremap() with 0 size return NULL
Date: Mon,  1 Aug 2011 13:31:07 +0100	[thread overview]
Message-ID: <1312201870-12921-6-git-send-email-jamie@jamieiles.com> (raw)
In-Reply-To: <1312201870-12921-1-git-send-email-jamie@jamieiles.com>

Without __arch_ioremap(), __get_vm_area_node() with a zero size will
return a NULL pointer.  Make the arch specific ioremap() do the same
thing.

Cc: Lennert Buytenhek <kernel@wantstofly.org>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
---
 arch/arm/mach-orion5x/include/mach/io.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-orion5x/include/mach/io.h b/arch/arm/mach-orion5x/include/mach/io.h
index c519610..8763328 100644
--- a/arch/arm/mach-orion5x/include/mach/io.h
+++ b/arch/arm/mach-orion5x/include/mach/io.h
@@ -20,6 +20,10 @@ __arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
 {
 	void __iomem *retval;
 	unsigned long offs = paddr - ORION5X_REGS_PHYS_BASE;
+
+	if (!size)
+		return NULL;
+
 	if (mtype == MT_DEVICE && size && offs < ORION5X_REGS_SIZE &&
 	    size <= ORION5X_REGS_SIZE && offs + size <= ORION5X_REGS_SIZE) {
 		retval = (void __iomem *)ORION5X_REGS_VIRT_BASE + offs;
-- 
1.7.4.1

  parent reply	other threads:[~2011-08-01 12:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01 12:31 [PATCH 1/9] davinci: make __arch_ioremap() with 0 size return NULL Jamie Iles
2011-08-01 12:31 ` [PATCH 2/9] ebsa110: " Jamie Iles
2011-08-01 12:31 ` [PATCH 3/9] ixp23xx: " Jamie Iles
2011-08-01 12:31 ` [PATCH 4/9] ixp4xx: " Jamie Iles
2011-08-01 12:31 ` [PATCH 5/9] kirkwood: " Jamie Iles
2011-08-01 12:31 ` Jamie Iles [this message]
2011-08-01 12:31 ` [PATCH 7/9] tegra: " Jamie Iles
2011-08-01 12:31 ` [PATCH 8/9] iop: " Jamie Iles
2011-08-01 12:31 ` [PATCH 9/9] omap: " Jamie Iles

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=1312201870-12921-6-git-send-email-jamie@jamieiles.com \
    --to=jamie@jamieiles.com \
    --cc=linux-arm-kernel@lists.infradead.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.