From patchwork Fri May 31 20:47:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2645481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 933F5DFB79 for ; Fri, 31 May 2013 20:47:32 +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 1UiWEU-0005br-Go; Fri, 31 May 2013 20:47:30 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiWER-0002p8-Ty; Fri, 31 May 2013 20:47:27 +0000 Received: from moutng.kundenserver.de ([212.227.17.8]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiWEO-0002oh-Rr for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2013 20:47:25 +0000 Received: from wuerfel.localnet (HSI-KBW-095-208-002-043.hsi5.kabel-badenwuerttemberg.de [95.208.2.43]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0Lql1O-1UEQbf2j7y-00eIfw; Fri, 31 May 2013 22:47:01 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: ux500: avoid warning in ux500_read_asicid Date: Fri, 31 May 2013 22:47:04 +0200 Message-ID: <2475820.dXNmmAuTaP@wuerfel> User-Agent: KMail/4.10.2 (Linux/3.10.0-rc3-next-20130527+; KDE/4.10.3; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V02:K0:BReRqGIg5cMJ9gY3zUAtKIld2+OCOFIuDhlbGswp7OW ptBAHlX6Pa4/Vt/uqT1bXYXFQ2D+ouc+KpQflb1G4tYmUMza/M i7wXQNcjfl1+LHfBXu3039tjcb9gQmc5WzXGauykD4d1YnU+PA gxoc3xX8Vwc31zedBjlVqV/nXL4IaNNvDKqC2ztqkyTokT0LV/ tHM6OnUwUfw/wNDzAKwCTPkCnJubadgELBIpG15+1dBGnUjeeW 6RO/Ihl/oFnnttUD9jgUz9mVxHwm9tav969UqwFH69g7RjdNXH 8W1Ql7pT4ABIO8/aqSoWubwQeQ/Voj4H0KIYPCayBCAnqDMwnP 0osQ8i2AO4reLi3b+V0c= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130531_164725_161325_FCB93176 X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. 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: Linus Walleij 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 phys_addr_t may be 64 bit, which causes this harmless warning in ux500_read_asicid: arch/arm/mach-ux500/id.c: In function 'ux500_read_asicid': arch/arm/include/asm/io.h:159:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] #define IOMEM(x) ((void __force __iomem *)(x)) ^ arch/arm/mach-ux500/id.c:40:9: note: in expansion of macro 'readl' return readl(IOMEM(UX500_VIRT_ROM + (addr & 0xfff))); We can solve this in a nicer way by making UX500_VIRT_ROM have a proper type to start with and calculating the address using pointer arithmetic. Signed-off-by: Arnd Bergmann Cc: Linus Walleij diff --git a/arch/arm/mach-ux500/db8500-regs.h b/arch/arm/mach-ux500/db8500-regs.h index b2d7a0b..bb4cc41 100644 --- a/arch/arm/mach-ux500/db8500-regs.h +++ b/arch/arm/mach-ux500/db8500-regs.h @@ -184,7 +184,7 @@ #define U8500_IO_VIRTUAL 0xf0000000 #define U8500_IO_PHYSICAL 0xa0000000 /* This is where we map in the ROM to check ASIC IDs */ -#define UX500_VIRT_ROM 0xf0000000 +#define UX500_VIRT_ROM IOMEM(0xf0000000) /* This macro is used in assembly, so no cast */ #define IO_ADDRESS(x) \ diff --git a/arch/arm/mach-ux500/id.c b/arch/arm/mach-ux500/id.c index 0d33d1a..392f2fd 100644 --- a/arch/arm/mach-ux500/id.c +++ b/arch/arm/mach-ux500/id.c @@ -21,11 +21,11 @@ struct dbx500_asic_id dbx500_id; -static unsigned int ux500_read_asicid(phys_addr_t addr) +static unsigned int __init ux500_read_asicid(phys_addr_t addr) { phys_addr_t base = addr & ~0xfff; struct map_desc desc = { - .virtual = UX500_VIRT_ROM, + .virtual = (unsigned long)UX500_VIRT_ROM, .pfn = __phys_to_pfn(base), .length = SZ_16K, .type = MT_DEVICE, @@ -37,7 +37,7 @@ static unsigned int ux500_read_asicid(phys_addr_t addr) local_flush_tlb_all(); flush_cache_all(); - return readl(IOMEM(UX500_VIRT_ROM + (addr & 0xfff))); + return readl(UX500_VIRT_ROM + (addr & 0xfff)); } static void ux500_print_soc_info(unsigned int asicid)