From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752819AbcD2Ibh (ORCPT ); Fri, 29 Apr 2016 04:31:37 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34837 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750758AbcD2Ibe (ORCPT ); Fri, 29 Apr 2016 04:31:34 -0400 Date: Fri, 29 Apr 2016 10:31:28 +0200 From: Ingo Molnar To: linux-kernel@vger.kernel.org, peterz@infradead.org, matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org, bp@alien8.de, tglx@linutronix.de, tony.luck@intel.com, hpa@zytor.com Cc: linux-tip-commits@vger.kernel.org Subject: [PATCH] efi: Remove unnecessary (and buggy) .memmap initialization from the Xen EFI driver Message-ID: <20160429083128.GA4925@gmail.com> References: <1461614832-17633-8-git-send-email-matt@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * tip-bot for Matt Fleming wrote: > Commit-ID: 884f4f66ffd6ffe632f3a8be4e6d10a858afdc37 > Gitweb: http://git.kernel.org/tip/884f4f66ffd6ffe632f3a8be4e6d10a858afdc37 > Author: Matt Fleming > AuthorDate: Mon, 25 Apr 2016 21:06:39 +0100 > Committer: Ingo Molnar > CommitDate: Thu, 28 Apr 2016 11:33:51 +0200 > > efi: Remove global 'memmap' EFI memory map > > Abolish the poorly named EFI memory map, 'memmap'. It is shadowed by a > bunch of local definitions in various files and having two ways to > access the EFI memory map ('efi.memmap' vs. 'memmap') is rather > confusing. > > Furthermore, IA64 doesn't even provide this global object, which has > caused issues when trying to write generic EFI memmap code. > > Replace all occurrences with efi.memmap, and convert the remaining > iterator code to use for_each_efi_mem_desc(). > > Signed-off-by: Matt Fleming > Reviewed-by: Ard Biesheuvel > Cc: Borislav Petkov > Cc: Luck, Tony > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Cc: linux-efi@vger.kernel.org > Link: http://lkml.kernel.org/r/1461614832-17633-8-git-send-email-matt@codeblueprint.co.uk > Signed-off-by: Ingo Molnar > --- > arch/x86/platform/efi/efi.c | 84 +++++++++++++++++++++----------------- > drivers/firmware/efi/arm-init.c | 20 ++++----- > drivers/firmware/efi/arm-runtime.c | 12 +++--- > drivers/firmware/efi/efi.c | 2 +- > drivers/firmware/efi/fake_mem.c | 40 +++++++++--------- > include/linux/efi.h | 5 +-- > 6 files changed, 85 insertions(+), 78 deletions(-) So this commit triggered the follwing build warning on x86 64-bit allyesconfig: In file included from ./include/uapi/linux/posix_types.h:4:0, from include/uapi/linux/types.h:13, from include/linux/compiler.h:203, from include/asm-generic/bug.h:4, from ./arch/x86/include/asm/bug.h:35, from include/linux/bug.h:4, from drivers/xen/efi.c:21: include/linux/stddef.h:7:14: warning: initialization makes integer from pointer without a cast [-Wint-conversion] #define NULL ((void *)0) ^ drivers/xen/efi.c:319:30: note: in expansion of macro ‘NULL’ .memmap = NULL, /* Not used under Xen. */ ^ CC drivers/gpu/drm/i915/intel_acpi.o include/linux/stddef.h:7:14: note: (near initialization for ‘efi_xen.memmap.phys_map’) #define NULL ((void *)0) ^ drivers/xen/efi.c:319:30: note: in expansion of macro ‘NULL’ .memmap = NULL, /* Not used under Xen. */ ^ drivers/xen/efi.c:290:47: warning: missing braces around initializer [-Wmissing-braces] static const struct efi efi_xen __initconst = { ^ drivers/xen/efi.c:290:47: note: (near initialization for ‘efi_xen’) It's this initialization in drivers/xen/efi.c: static const struct efi efi_xen __initconst = { ... .memmap = NULL, /* Not used under Xen. */ ... which was forgotten about, as .memmap now is an embedded struct: struct efi_memory_map memmap; We can remove this initialization - it's an EFI core internal data structure plus it's not used in the Xen driver anyway. Signed-off-by: Ingo Molnar --- drivers/xen/efi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/xen/efi.c b/drivers/xen/efi.c index be7e56a338e8..e9d2135445c1 100644 --- a/drivers/xen/efi.c +++ b/drivers/xen/efi.c @@ -316,7 +316,6 @@ static const struct efi efi_xen __initconst = { .get_next_high_mono_count = xen_efi_get_next_high_mono_count, .reset_system = NULL, /* Functionality provided by Xen. */ .set_virtual_address_map = NULL, /* Not used under Xen. */ - .memmap = NULL, /* Not used under Xen. */ .flags = 0 /* Initialized later. */ };