Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933365AbcKMJKm (ORCPT ); Sun, 13 Nov 2016 04:10:42 -0500 Received: from terminus.zytor.com ([198.137.202.10]:58588 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933179AbcKMJKj (ORCPT ); Sun, 13 Nov 2016 04:10:39 -0500 Date: Sun, 13 Nov 2016 01:09:28 -0800 From: tip-bot for Borislav Petkov Message-ID: Cc: jpoimboe@redhat.com, ard.biesheuvel@linaro.org, peterz@infradead.org, torvalds@linux-foundation.org, bp@suse.de, matt@codeblueprint.co.uk, bp@alien8.de, luto@kernel.org, dvlasenk@redhat.com, linux-kernel@vger.kernel.org, brgerst@gmail.com, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org Reply-To: torvalds@linux-foundation.org, bp@suse.de, ard.biesheuvel@linaro.org, peterz@infradead.org, jpoimboe@redhat.com, bp@alien8.de, matt@codeblueprint.co.uk, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, brgerst@gmail.com, luto@kernel.org, dvlasenk@redhat.com, mingo@kernel.org In-Reply-To: <20161112210424.5157-2-matt@codeblueprint.co.uk> References: <20161112210424.5157-2-matt@codeblueprint.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/urgent] x86/efi: Fix EFI memmap pointer size warning Git-Commit-ID: 02e56902e40e4c1ff57590c717e46377b72d5966 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2331 Lines: 62 Commit-ID: 02e56902e40e4c1ff57590c717e46377b72d5966 Gitweb: http://git.kernel.org/tip/02e56902e40e4c1ff57590c717e46377b72d5966 Author: Borislav Petkov AuthorDate: Sat, 12 Nov 2016 21:04:23 +0000 Committer: Ingo Molnar CommitDate: Sun, 13 Nov 2016 08:26:40 +0100 x86/efi: Fix EFI memmap pointer size warning Fix this when building on 32-bit: arch/x86/platform/efi/efi.c: In function ‘__efi_enter_virtual_mode’: arch/x86/platform/efi/efi.c:911:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (efi_memory_desc_t *)pa); ^ arch/x86/platform/efi/efi.c:918:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] (efi_memory_desc_t *)pa); ^ The @pa local variable is declared as phys_addr_t and that is a u64 when CONFIG_PHYS_ADDR_T_64BIT=y. (The last is enabled on 32-bit on a PAE build.) However, its value comes from __pa() which is basically doing pointer arithmetic and checking, and returns unsigned long as it is the native pointer width. So let's use an unsigned long too. It should be fine to do so because the later users cast it to a pointer too. Signed-off-by: Borislav Petkov Signed-off-by: Matt Fleming Cc: Andy Lutomirski Cc: Ard Biesheuvel Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20161112210424.5157-2-matt@codeblueprint.co.uk Signed-off-by: Ingo Molnar --- arch/x86/platform/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index bf99aa7..936a488 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -861,7 +861,7 @@ static void __init __efi_enter_virtual_mode(void) int count = 0, pg_shift = 0; void *new_memmap = NULL; efi_status_t status; - phys_addr_t pa; + unsigned long pa; efi.systab = NULL;