Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754287Ab1EHMzX (ORCPT ); Sun, 8 May 2011 08:55:23 -0400 Received: from service87.mimecast.com ([94.185.240.25]:42744 "HELO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753168Ab1EHMv4 (ORCPT ); Sun, 8 May 2011 08:51:56 -0400 From: Catalin Marinas To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Russell King - ARM Linux Subject: [PATCH v5 03/19] ARM: LPAE: Use unsigned long for __phys_to_virt and __virt_to_phys Date: Sun, 8 May 2011 13:51:22 +0100 Message-Id: <1304859098-10760-4-git-send-email-catalin.marinas@arm.com> X-Mailer: git-send-email 1.7.4.2.g597a6 In-Reply-To: <1304859098-10760-1-git-send-email-catalin.marinas@arm.com> References: <1304859098-10760-1-git-send-email-catalin.marinas@arm.com> X-OriginalArrivalTime: 08 May 2011 12:51:48.0663 (UTC) FILETIME=[B1C83470:01CC0D7E] X-MC-Unique: 111050813515302701 Content-Type: text/plain; charset=WINDOWS-1252 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id p48CtUbW020107 Content-Length: 1259 Lines: 32 The !CONFIG_ARM_PATCH_PHYS_VIRT case uses macros for __phys_to_virt and __virt_to_phys but does not use any type casting. This causes issues with LPAE where the phys_addr_t is 64-bit. Note that these macros are only valid for lowmem physical addresses where the range is within 32-bit. Signed-off-by: Catalin Marinas --- arch/arm/include/asm/memory.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 431077c..10e4b4c 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -194,8 +194,8 @@ static inline unsigned long __phys_to_virt(unsigned long x) return t; } #else -#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) +#define __virt_to_phys(x) ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET) +#define __phys_to_virt(x) ((unsigned long)(x) - PHYS_OFFSET + PAGE_OFFSET) #endif #endif -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/