linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
To: linux-sh@vger.kernel.org
Subject: [PATCH 2/2] sh: Add sh_io_port_base check in __ioport_map function
Date: Sun, 27 Mar 2011 04:31:47 +0000	[thread overview]
Message-ID: <1301200307-5321-2-git-send-email-iwamatsu@nigauri.org> (raw)

sh_io_port_base is initialized with -1.
When user use sh_io_port_base, IO port address -1 slips off.
This revise it if sh_io_port_base was set -1.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 arch/sh/kernel/ioport.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/sh/kernel/ioport.c b/arch/sh/kernel/ioport.c
index e3ad610..30937e9 100644
--- a/arch/sh/kernel/ioport.c
+++ b/arch/sh/kernel/ioport.c
@@ -19,6 +19,10 @@ void __iomem *__ioport_map(unsigned long addr, unsigned int size)
 	if (sh_mv.mv_ioport_map)
 		return sh_mv.mv_ioport_map(addr, size);
 
+	/* Don't use sh_io_port_base */
+	if (sh_io_port_base = -1)
+		return (void __iomem *)addr;
+
 	return (void __iomem *)(addr + sh_io_port_base);
 }
 EXPORT_SYMBOL(__ioport_map);
-- 
1.7.4.1


             reply	other threads:[~2011-03-27  4:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-27  4:31 Nobuhiro Iwamatsu [this message]
2011-03-27  6:37 ` [PATCH 2/2] sh: Add sh_io_port_base check in __ioport_map function Daniel Palmer
2011-03-27  7:45 ` Nobuhiro Iwamatsu
2011-03-28 14:08 ` Daniel Palmer
2011-03-28 23:29 ` Nobuhiro Iwamatsu
2011-03-30  7:37 ` Daniel Palmer

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=1301200307-5321-2-git-send-email-iwamatsu@nigauri.org \
    --to=iwamatsu@nigauri.org \
    --cc=linux-sh@vger.kernel.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).