From patchwork Wed Jul 27 20:10:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 9250371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4B7C260757 for ; Wed, 27 Jul 2016 20:12:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E9E8237A5 for ; Wed, 27 Jul 2016 20:12:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3386826253; Wed, 27 Jul 2016 20:12:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B9498237A5 for ; Wed, 27 Jul 2016 20:12:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bSVAx-0007GC-EC; Wed, 27 Jul 2016 20:11:31 +0000 Received: from mail-qt0-x22f.google.com ([2607:f8b0:400d:c0d::22f]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bSVAP-0007FC-Vj for linux-arm-kernel@lists.infradead.org; Wed, 27 Jul 2016 20:11:02 +0000 Received: by mail-qt0-x22f.google.com with SMTP id w38so36662224qtb.0 for ; Wed, 27 Jul 2016 13:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:subject:message-id:user-agent:mime-version; bh=I4olkDM7Z6QrGdqCRhx8W6CTehL3mz5nDUXTNJzoiTg=; b=XzwKcXHzSSTHd7KPckFZYBQQ4XsU5kVVtRkU9NY8u2B8K5Lu9bK0B+HsTkFgkVmmUU lQ81BjX+39hxjTwSXtNGXuoqXohELpMtg+/WnYScLyENgBaAr/IdHPhhpVADaxmW22ZG BFB0DDrEcVm0Yrk5RCXL0cLbGY9LKMKEE9qOg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version; bh=I4olkDM7Z6QrGdqCRhx8W6CTehL3mz5nDUXTNJzoiTg=; b=DupUN4qTlh6QSpFR6slpopIjG/4tJOYA6GM+a/vsnN1LJrbUmb8MZtBatsIdSGcr7V NLKmFK+rNQ9Hq6ly7UAGQKHfvftanuhdsabm33lCmXXak6lvnsu7cqyuGOZIXYU6a1E1 Fqk/ZMMwzJQHBtIAaeX1Hy2+wDFKiug/pVmSQxOiN/SWTR9gvWwFZ1cKK0XPJZyf3/Z4 bW/PBjS522/DKCSkpi3CGu7A9sKog0FP8IxQ/OKAJgB2UnZITGXh734tNogijql9vKho Fyr3mJqoB6tpdH8RedhO9AS2X+D9xphKB4VSr3HPsuuEvcvzLUWVEDLj+k6z5PxZdXbV bQVw== X-Gm-Message-State: AEkoouv6Xr+Pcj04lzG7zd0AcSB8KzDBzRodHMoexc3CH/fEqb28JIXy0fRzpX1VDscShd5Y X-Received: by 10.237.42.197 with SMTP id t63mr51005221qtd.84.1469650236339; Wed, 27 Jul 2016 13:10:36 -0700 (PDT) Received: from xanadu.home ([2607:fa48:6e39:d410:feaa:14ff:fea7:ed77]) by smtp.gmail.com with ESMTPSA id 73sm5227674qtc.16.2016.07.27.13.10.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jul 2016 13:10:35 -0700 (PDT) Date: Wed, 27 Jul 2016 16:10:34 -0400 (EDT) From: Nicolas Pitre To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] asm/memory.h: remove dead definitions Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160727_131058_244450_CEC91331 X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 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-Virus-Scanned: ClamAV using ClamSMTP The last ad-hoc __phys_to_virt definition was removed in commit fd0053c9 ("ARM: realview: remove sparsemem hack"). Therefore we can remove the unneeded definitions and unduplicate the virt_to_pfn macro from asm/memory.h. Signed-off-by: Nicolas Pitre diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 31c07a2cc1..76cbd9c674 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -159,13 +159,8 @@ * PFNs are used to describe any physical page; this means * PFN 0 == physical address 0. */ -#if defined(__virt_to_phys) -#define PHYS_OFFSET PLAT_PHYS_OFFSET -#define PHYS_PFN_OFFSET ((unsigned long)(PHYS_OFFSET >> PAGE_SHIFT)) - -#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) -#elif defined(CONFIG_ARM_PATCH_PHYS_VIRT) +#if defined(CONFIG_ARM_PATCH_PHYS_VIRT) /* * Constants used to force the right instruction encodings and shifts @@ -182,10 +177,6 @@ extern const void *__pv_table_begin, *__pv_table_end; #define PHYS_OFFSET ((phys_addr_t)__pv_phys_pfn_offset << PAGE_SHIFT) #define PHYS_PFN_OFFSET (__pv_phys_pfn_offset) -#define virt_to_pfn(kaddr) \ - ((((unsigned long)(kaddr) - PAGE_OFFSET) >> PAGE_SHIFT) + \ - PHYS_PFN_OFFSET) - #define __pv_stub(from,to,instr,type) \ __asm__("@ __pv_stub\n" \ "1: " instr " %0, %1, %2\n" \ @@ -257,12 +248,12 @@ static inline unsigned long __phys_to_virt(phys_addr_t x) return x - PHYS_OFFSET + PAGE_OFFSET; } +#endif + #define virt_to_pfn(kaddr) \ ((((unsigned long)(kaddr) - PAGE_OFFSET) >> PAGE_SHIFT) + \ PHYS_PFN_OFFSET) -#endif - /* * These are *only* valid on the kernel direct mapped RAM memory. * Note: Drivers should NOT use these. They are the wrong