linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 10/11] iomap: sort out the broken address reporting caused by the iomap layer
@ 2007-07-09 18:46 akpm
  2007-07-20 12:11 ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: akpm @ 2007-07-09 18:46 UTC (permalink / raw)
  To: jeff; +Cc: linux-ide, akpm, alan, alan, htejun

From: Alan Cox <alan@lxorguk.ukuu.org.uk>

Add an iomap_name() function which translates an I/O map into a string to
print.

Use it for the Libata layer

For now we use 0xXXXX for I/O and 0xXXXXXXXX for MMIO.  I'm assuming that
eventually some other platforms will want to use their own iomap_name() and
we can add ARCH_HAVE_IOMAP_NAME later as such a platform needs it.

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/asm-generic/iomap.h |    5 +++++
 lib/iomap.c                 |   12 ++++++++++++
 2 files changed, 17 insertions(+)

diff -puN include/asm-generic/iomap.h~iomap-sort-out-the-broken-address-reporting-caused-by-the-iomap-layer include/asm-generic/iomap.h
--- a/include/asm-generic/iomap.h~iomap-sort-out-the-broken-address-reporting-caused-by-the-iomap-layer
+++ a/include/asm-generic/iomap.h
@@ -65,4 +65,9 @@ struct pci_dev;
 extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
 extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
 
+/* Convert an iomap to text for this platform */
+extern char *iomap_name(void __iomem *addr, char *buf, size_t len);
+#define IOMAP_NAMELEN	12
+
+
 #endif
diff -puN lib/iomap.c~iomap-sort-out-the-broken-address-reporting-caused-by-the-iomap-layer lib/iomap.c
--- a/lib/iomap.c~iomap-sort-out-the-broken-address-reporting-caused-by-the-iomap-layer
+++ a/lib/iomap.c
@@ -268,3 +268,15 @@ void pci_iounmap(struct pci_dev *dev, vo
 }
 EXPORT_SYMBOL(pci_iomap);
 EXPORT_SYMBOL(pci_iounmap);
+
+char *iomap_name(void __iomem *port, char *buf, size_t len)
+{
+	if (port == NULL) {
+		snprintf(buf, len, "None");
+		return buf;
+	}
+	IO_COND(port, snprintf(buf, len, "0x%04lx", port),
+		snprintf(buf, len, "%08lx", port));
+	return buf;
+}
+EXPORT_SYMBOL(iomap_name);
_

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-20 12:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-09 18:46 [patch 10/11] iomap: sort out the broken address reporting caused by the iomap layer akpm
2007-07-20 12:11 ` Jeff Garzik
2007-07-20 12:22   ` Alan Cox
2007-07-20 12:24     ` Jeff Garzik

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).