Re: [PATCH] m68knommu: change definitions of __pa() and __va()

From: Greg Ungerer
Date: Tue Jan 12 2010 - 04:45:23 EST

On 01/12/2010 05:02 PM, Greg Ungerer wrote:
Linus Torvalds wrote:
On Tue, 12 Jan 2010, Greg Ungerer wrote:
+#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
+#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)

Ok, so the old ones were total crap too, but when moving things
around, don't just copy the crap like this.

Look at those two #define's for five seconds, and ask yourself what is
wrong with them. Those macros are not good.

Ok. Easily fixed.

page_to_bus() doesn't even look like it is used anywhere (and m68k
itself doesn't define it). So I'll remove it.

I propose changing page_to_phys() to be:

#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)

Hmmm, on second thoughts maybe that change is better left
for the next merge window. Perhaps best to just fix that
arg bracketization now?

Which seems consistent with many other arches. (And it works on
m68knommu too :-)

I'll generate a new patch with that changed.

A quick grep shows page_to_phys() defined this way in a couple of
other places too:


Strike that, only the h8300 one needs arg fixing.


Greg Ungerer -- Principal Engineer EMAIL: gerg@xxxxxxxxxxxx
SnapGear Group, McAfee PHONE: +61 7 3435 2888
8 Gardner Close, FAX: +61 7 3891 3630
Milton, QLD, 4064, Australia WEB:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at