Path: csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod From: Ingo Molnar Newsgroups: linux.kernel Subject: [PATCH] efi: Remove unnecessary (and buggy) .memmap initialization from the Xen EFI driver Date: Fri, 29 Apr 2016 10:40:02 +0200 Message-ID: References: X-Original-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 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=zgL5yZfTiecmkhYE/UO2f+pO9w9/hZ/IitiQjDntiKc=; b=xqyodlv3g6R16lpW4NlL6Ay0PYl1I7mHAmhO3Vlxw1U8IQlksUoQi+mpgYrhwG4cbo hyZ2g8r+PYnaUw866QuQzHVbqwu+Ew9Q/YgoAachr6BnBGKwXtzWXfajDkFQQ0wJmUnM UdzG/Q4QSQ0wxGEXfgO7awe6axazMOYZTR1g4gRW+NAWkv80QR8LMJQJ1CSvwK7WaBNX 5+K486ryNTNyS5Y6ZcGHqiofk+MP6dKA8AWtuLjsSEQXGZTbXtVkUvQCfGaTShCz7klv p/kvWqJBR9y7kfEyS9sam6X+hf1PT1aG0XaaD+YH5NHnGdNX51ne/J0pPElKmOBAY9mh xz+w== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=zgL5yZfTiecmkhYE/UO2f+pO9w9/hZ/IitiQjDntiKc=; b=BX7wFGKFKXY/u3Y6WNOZ0iHtG2Pi9PDLCU4R9+XtAe+3+UTJySIjbekHaB9DR7YXxv 9o8DOym8zHJeFmtwJxrr+kVVrgc6QN0aJSDc5Gg+CBURbZ43V5J+HhlqYwSxmHLyfexc qutF+B7NGlx8+ImNL8TSEUlliTEUu3fwJE6uFn4RdjvSKB+SIE/mns3m3aZ/+cpOGzOM kPuF5uigrAi2H/vWaNeqynac+LBa9+jGTyBqZmRWwLZH1wKMva8lJUlnTVkmNs/N/btH Svf/KTbBcVDKADWsyBQ49YDeNAsMlNmAjBLX0W34Ap9E9EWWZVUxt80oVfTGih0tO786 Jplw== X-Gm-Message-State: AOPr4FWoVuN1ea5kciIKPq0knF47Aum/SwerIjL0aG6+f/qJKlVha2d4hVZr4LzRaxdyzQ== X-Received: by 10.194.168.231 with SMTP id zz7mr5080984wjb.89.1461918692355; Fri, 29 Apr 2016 01:31:32 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23 (2014-03-12) Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 100 Organization: linux.* mail to news gateway X-Original-Cc: linux-tip-commits@vger.kernel.org X-Original-Date: Fri, 29 Apr 2016 10:31:28 +0200 X-Original-Message-ID: <20160429083128.GA4925@gmail.com> X-Original-References: <1461614832-17633-8-git-send-email-matt@codeblueprint.co.uk> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1390865 * 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. */ };