linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Judith Lebzelter <judith@osdl.org>
Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: [2.6 patch] mark virt_to_bus/bus_to_virt as __deprecated on i386
Date: Tue, 3 Oct 2006 03:22:41 +0200	[thread overview]
Message-ID: <20061003012241.GF3278@stusta.de> (raw)
In-Reply-To: <20061002234428.GE3278@stusta.de>

On Tue, Oct 03, 2006 at 01:44:28AM +0200, Adrian Bunk wrote:
> On Mon, Oct 02, 2006 at 02:49:54PM -0700, Judith Lebzelter wrote:
> 
> > Hello:
> 
> Hi Judith,
> 
> > For the automated cross-compile builds at OSDL, powerpc 64-bit 
> > 'allmodconfig' is failing.  The warnings/errors below appear in 
> > the 'modpost' stage of kernel compiles for 2.6.18 and -mm2 kernels.
> 
> known for ages - the drivers need fixing.
> 
> You might want to convince Andrew accepting my patch to make 
> virt_to_bus/bus_to_virt give compile warnings on i386 for making
> people more aware of this problem...
>...

In case anyone is interested, the patch is below.

cu
Adrian


<--  snip  -->


virt_to_bus/bus_to_virt are long deprecated, mark them as __deprecated 
on i386.

Without such warnings people will never update their code and fix 
the errors in PPC64 builds.

And yes, some of the drivers affected are maintained.

This also catches accidential additions of users for these functions 
like a usage of bus_to_virt() in the infiniband code that was added in 
2.6.17-rc1 (already removed).

This patch increases the number of warnings shown during builds, but it 
seems worth including it at least in -mm for making people aware of this 
issue.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

This patch was already sent on:
- 7 Jul 2006
- 26 Jun 2006
- 27 Apr 2006
- 19 Apr 2006
- 6 Jan 2006
- 13 Dec 2005
- 23 Nov 2005
- 18 Nov 2005
- 12 Nov 2005

--- linux-2.6.14-mm2-full/include/asm-i386/io.h.old	2005-11-12 01:44:38.000000000 +0100
+++ linux-2.6.14-mm2-full/include/asm-i386/io.h	2005-11-12 01:45:58.000000000 +0100
@@ -144,8 +144,14 @@
  *
  * Allow them on x86 for legacy drivers, though.
  */
-#define virt_to_bus virt_to_phys
-#define bus_to_virt phys_to_virt
+static inline unsigned long __deprecated virt_to_bus(volatile void * address)
+{
+	return __pa(address);
+}
+static inline void * __deprecated bus_to_virt(unsigned long address)
+{
+	return __va(address);
+}
 
 /*
  * readX/writeX() are used to access memory mapped devices. On some

  reply	other threads:[~2006-10-03  1:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-02 21:49 Undefined '.bus_to_virt', '.virt_to_bus' causes compile error on Powerpc 64-bit Judith Lebzelter
2006-10-02 23:44 ` Adrian Bunk
2006-10-03  1:22   ` Adrian Bunk [this message]
2006-10-03  1:48     ` [2.6 patch] mark virt_to_bus/bus_to_virt as __deprecated on i386 Nicholas Miell
2006-10-03  1:58       ` Adrian Bunk
2006-10-03  2:55         ` Nicholas Miell
2006-10-03  4:37       ` Benjamin Herrenschmidt
2006-10-03 11:29         ` Alan Cox
2006-10-03  4:37     ` Benjamin Herrenschmidt
2006-10-03  4:44       ` Andrew Morton
2006-10-03  4:49         ` Benjamin Herrenschmidt
2006-10-03  4:55           ` Andrew Morton
2006-10-03  5:07             ` Adrian Bunk
2006-10-03  9:36           ` Stefan Richter
2006-10-03 11:24     ` Alan Cox
2006-10-03 20:58   ` Undefined '.bus_to_virt', '.virt_to_bus' causes compile error on Powerpc 64-bit Guennadi Liakhovetski
2006-10-03  1:05 ` Benjamin Herrenschmidt
2006-10-03 11:23   ` Alan Cox
2006-10-03  1:16 ` Paul Mackerras

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=20061003012241.GF3278@stusta.de \
    --to=bunk@stusta.de \
    --cc=judith@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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).