From patchwork Mon Nov 25 23:34:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 3235161 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 726969F3B8 for ; Mon, 25 Nov 2013 23:35:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E3C2201F4 for ; Mon, 25 Nov 2013 23:35:37 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97DB22018E for ; Mon, 25 Nov 2013 23:35:36 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vl5gj-0001yF-03; Mon, 25 Nov 2013 23:35:33 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vl5gg-0002o3-CT; Mon, 25 Nov 2013 23:35:30 +0000 Received: from quartz.orcorp.ca ([184.70.90.242]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vl5gd-0002na-EK for linux-arm-kernel@lists.infradead.org; Mon, 25 Nov 2013 23:35:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=PT21As3YOv6YTCVxztmKeSZOot5Deu1/1DtcQZsVOr0=; b=Of1bagJndsWg1c9VTvOlTyE7GnW3dToo9as7KztRpiHuzZqLzeX8GUa26EPW257XslYNLGfxiRzTmUmqwAWVCsqMyMjGv/R0vgJ6/uGWXdomls5Ouzaw93T8vcEZOvwZm3zCxmYaFR+3kgYNHY8203jSv3ONf07uzBCFxLsmbxA=; Received: from [10.0.0.161] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Vl5gB-0008Rh-6l; Mon, 25 Nov 2013 16:34:59 -0700 Received: from jgg by jggl.edm.orcorp.ca with local (Exim 4.80) (envelope-from ) id 1Vl5gA-0005gB-Q7; Mon, 25 Nov 2013 16:34:58 -0700 Date: Mon, 25 Nov 2013 16:34:58 -0700 From: Jason Gunthorpe To: Russell King - ARM Linux Subject: Re: Build breakage from 'ARM: mm: use phys_addr_t appropriately in p2v and v2p conversions' Message-ID: <20131125233458.GA19852@obsidianresearch.com> References: <20131125223636.GA20822@obsidianresearch.com> <20131125232003.GU16735@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20131125232003.GU16735@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.161 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131125_183527_611364_B6BEBE9D X-CRM114-Status: GOOD ( 16.42 ) X-Spam-Score: -2.0 (--) Cc: Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, Nicolas Pitre X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Nov 25, 2013 at 11:20:03PM +0000, Russell King - ARM Linux wrote: > On Mon, Nov 25, 2013 at 03:36:36PM -0700, Jason Gunthorpe wrote: > > Which is after your new inlines.. > > > > An elegant fix wasn't obvious to me :) > > Same here... it's all rather complicated because of all those ifdefs. > Nothing easy comes to mind about how to fix this one. I'll look into > it at some point. > > If not, it's going to have to be a revert - or we bite the bullet and > start killing off some of these Kconfig options such as making > ARM_PATCH_PHYS_VIRT mandatory. This is enough to fix the build: I don't seen an obvious major downside to loosing the inline, static checking will have to be done with the ARM_PATCH_PHYS_VIRT branch.. I'm working on runtime testing this, let me know if you want a proper patch. Regards, Jason diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index eaf428c..b886eba 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -239,15 +239,8 @@ static inline unsigned long __phys_to_virt(phys_addr_t x) #else -static inline phys_addr_t __virt_to_phys(unsigned long x) -{ - return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET; -} - -static inline unsigned long __phys_to_virt(phys_addr_t x) -{ - return x - PHYS_OFFSET + PAGE_OFFSET; -} +#define __virt_to_phys(x) ((phys_addr_t)(x) - PAGE_OFFSET + PHYS_OFFSET) +#define __phys_to_virt(x) ((unsigned long)((phys_addr_t)(x) - PHYS_OFFSET + PAGE_OFFSET)) #endif #endif