public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@snapgear.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: gerg@uclinux.org, linux-m68k@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] m68knommu: change definitions of __pa() and __va()
Date: Tue, 12 Jan 2010 17:02:26 +1000	[thread overview]
Message-ID: <4B4C1E82.7000907@snapgear.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1001111652500.17145@localhost.localdomain>


Hi Linus,

Linus Torvalds wrote:
> On Tue, 12 Jan 2010, Greg Ungerer wrote:
>> +#else
>> +#define page_to_phys(page)	((page - mem_map) << PAGE_SHIFT)
>> +#define page_to_bus(page)	((page - mem_map) << PAGE_SHIFT)
>> +#endif
> 
> 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)

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:

   h8300/include/asm/io.h
   sparc/include/asm/io_32.h

Regards
Greg



------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     gerg@snapgear.com
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com

  reply	other threads:[~2010-01-12  7:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-12  0:39 [PATCH] m68knommu: change definitions of __pa() and __va() Greg Ungerer
2010-01-12  0:53 ` Linus Torvalds
2010-01-12  7:02   ` Greg Ungerer [this message]
2010-01-12  9:45     ` Greg Ungerer

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=4B4C1E82.7000907@snapgear.com \
    --to=gerg@snapgear.com \
    --cc=gerg@uclinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=torvalds@linux-foundation.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