From patchwork Thu Feb 14 13:49:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2141921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 0E9ED3FCFC for ; Thu, 14 Feb 2013 13:53:00 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5zCU-0005pQ-Bz; Thu, 14 Feb 2013 13:50:10 +0000 Received: from moutng.kundenserver.de ([212.227.17.8]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U5zBr-0005hQ-8n for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2013 13:49:32 +0000 Received: from wuerfel.lan (HSI-KBW-46-223-90-92.hsi.kabel-badenwuerttemberg.de [46.223.90.92]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LgvGY-1Uishy26Ra-00oANr; Thu, 14 Feb 2013 14:49:28 +0100 From: Arnd Bergmann To: arm@kernel.org Subject: [PATCH 01/11] ARM: disable virt_to_bus/virt_to_bus almost everywhere Date: Thu, 14 Feb 2013 14:49:17 +0100 Message-Id: <1360849767-1463135-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1360849767-1463135-1-git-send-email-arnd@arndb.de> References: <1360849767-1463135-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:EBUtLsxuqphRi2Y5zXjq3UpcYx9Ra5oZppNL420oo4V KOJF8+HV3C5SEA1GiYPi1p0G0sum3dAawlxBWDpFBO54XIMmPM AUJ8Bbc44+ybjXrmkLnj+oFkr5hrUlrbom1C5DbkRKHCwfymeC hm56m2QnkrnJW+BgKFWvPohiWQE483f2KDJPqJzG0xJETGlYJN EAD9MaCEXZWh09YzOpgDARXWBsRj3yVZLp4LQZesM4Cr6LkuHq uucrSIyeoHYp6ltKsL1k/MUhDPd08xWMy1lTkp+yNeggGjiWeu cmuMhzPU59WgQClxQ70Q0tYXRtHivl2UAr5nysw1NQ6Qn2NR2g ro5ztJtWrWMgFCaqFdwPcKpALw//ZAiy/7PfStJjP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130214_084931_546918_81D801FD X-CRM114-Status: GOOD ( 17.62 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.8 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Arnd Bergmann , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We are getting a number of warnings about the use of the deprecated bus_to_virt function in drivers using the ARM ISA DMA API: drivers/parport/parport_pc.c: In function 'parport_pc_fifo_write_block_dma': drivers/parport/parport_pc.c:622:3: warning: 'bus_to_virt' is deprecated (declared at arch/arm/include/asm/memory.h:253) [-Wdeprecated-declarations] This is only because that function gets used by the inline set_dma_addr() helper. We know that any driver for the ISA DMA API is correctly using the DMA addresses, so we can change this to use the __bus_to_virt() function instead, which does not warn. After this, there are no remaining drivers that are used on any defconfigs on ARM using virt_to_bus or bus_to_virt, with the exception of the OSS sound driver. That driver is only used on RiscPC, NetWinder and Shark, so we can set ARCH_NO_VIRT_TO_BUS on all other platforms and hide the deprecated functions, which is far more effective than marking them as deprecated, in order to avoid any new users of that code. Signed-off-by: Arnd Bergmann Cc: Russell King --- arch/arm/Kconfig | 4 ++++ arch/arm/configs/shark_defconfig | 1 - arch/arm/include/asm/dma.h | 2 +- arch/arm/include/asm/memory.h | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 67874b8..91d4aea 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1450,6 +1450,10 @@ config ISA_DMA bool select ISA_DMA_API +config ARCH_NO_VIRT_TO_BUS + def_bool y + depends on !ARCH_RPC && !ARCH_NETWINDER && !ARCH_SHARK + # Select ISA DMA interface config ISA_DMA_API bool diff --git a/arch/arm/configs/shark_defconfig b/arch/arm/configs/shark_defconfig index caa07db..e319b2c 100644 --- a/arch/arm/configs/shark_defconfig +++ b/arch/arm/configs/shark_defconfig @@ -73,7 +73,6 @@ CONFIG_PARTITION_ADVANCED=y CONFIG_NLS_CODEPAGE_437=m CONFIG_NLS_CODEPAGE_850=m CONFIG_NLS_ISO8859_1=m -# CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set CONFIG_DEBUG_KERNEL=y # CONFIG_SCHED_DEBUG is not set diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h index 5694a0d..58b8c6a 100644 --- a/arch/arm/include/asm/dma.h +++ b/arch/arm/include/asm/dma.h @@ -105,7 +105,7 @@ extern void set_dma_sg(unsigned int chan, struct scatterlist *sg, int nr_sg); */ extern void __set_dma_addr(unsigned int chan, void *addr); #define set_dma_addr(chan, addr) \ - __set_dma_addr(chan, bus_to_virt(addr)) + __set_dma_addr(chan, (void *)__bus_to_virt(addr)) /* Set the DMA byte count for this channel * diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 1c4df27..474e2e6 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -245,6 +245,7 @@ static inline void *phys_to_virt(phys_addr_t x) #define __bus_to_pfn(x) __phys_to_pfn(x) #endif +#ifdef CONFIG_VIRT_TO_BUS static inline __deprecated unsigned long virt_to_bus(void *x) { return __virt_to_bus((unsigned long)x); @@ -254,6 +255,7 @@ static inline __deprecated void *bus_to_virt(unsigned long x) { return (void *)__bus_to_virt(x); } +#endif /* * Conversion between a struct page and a physical address.