Skip to contentSkip to conversation

define empty unxlate_dev_mem_ptr on AVR32

PATCH In review Ben Nizette 3 participants 4 messages Jan 23, 2008 – Jan 27, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 define empty unxlate_dev_mem_ptr on AVR32

Defined as a NOP on AVR32 as per the asm-generic implementation. This keeps /dev/mem happy.

---

include/asm-avr32/io.h +6 -0
Index: linux-2.6.24-rc8-mm1/include/asm-avr32/io.h
===================================================================
@@ -305,6 +305,12 @@ extern void __iounmap(void __iomem *addr
 #define xlate_dev_mem_ptr(p)    __va(p)
 
 /*
+ * We just keep an empty definition of this around (a-la the asm-generic
+ * implementation) to keep /dev/mem happy
+ */
+#define unxlate_dev_mem_ptr(p, a) {}
+
+/*
  * Convert a virtual cached pointer to an uncached pointer
  */
 #define xlate_dev_kmem_ptr(p)   p
#1 lore raw
Quoted 5 lines · On Wed, 23 Jan 2008 22:53:54 +1100 Ben Nizette <[email protected]> wrote:

/*
+ * We just keep an empty definition of this around (a-la the asm-generic
+ * implementation) to keep /dev/mem happy
+ */
+#define unxlate_dev_mem_ptr(p, a) {}

Thanks, but this should be either

#define unxlate_dev_mem_ptr(p, a) do { } while (0)

or

static inline void unxlate_dev_mem_ptr(unsigned long phys, void *addr) {
}

I prefer the latter.

Btw, the breakage was introduced by git-x86.patch. Should I take the fix through my avr32 tree?

Haavard

#2 lore raw
Quoted 13 lines · Haavard Skinnemoen
Quoted 5 lines · On Wed, 23 Jan 2008 22:53:54 +1100 Ben Nizette <[email protected]> wrote:

/*
+ * We just keep an empty definition of this around (a-la the asm-generic
+ * implementation) to keep /dev/mem happy
+ */
+#define unxlate_dev_mem_ptr(p, a) {}

Thanks, but this should be either

#define unxlate_dev_mem_ptr(p, a) do { } while (0)

Quoted 7 lines

or

static inline void unxlate_dev_mem_ptr(unsigned long phys, void *addr) {
}

I prefer the latter.

Yeah I don't know what came over me; Mia culpa :-)

I prefer the latter too, though I think I was striving for consistency with the xlate_dev_mem_ptr #define.

--Ben

#3 lore raw
In reply to Ben Nizette
Quoted 4 lines · Ben Nizette

+ * We just keep an empty definition of this around (a-la the asm-generic
+ * implementation) to keep /dev/mem happy
+ */
+#define unxlate_dev_mem_ptr(p, a) {}

We havent had the PAT patches in x86.git for some time so there's no unxlate_dev_mem_ptr() introduced. Perhaps this is for older -mm?

Ingo