From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752672AbdA1WVU (ORCPT ); Sat, 28 Jan 2017 17:21:20 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34115 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752615AbdA1WUt (ORCPT ); Sat, 28 Jan 2017 17:20:49 -0500 From: Ingo Molnar To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Andy Lutomirski , Borislav Petkov , "H . Peter Anvin" , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Yinghai Lu Subject: [PATCH 05/50] x86/boot/e820: Clean up the E820_X_MAX definition Date: Sat, 28 Jan 2017 23:11:26 +0100 Message-Id: <1485641531-22124-6-git-send-email-mingo@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485641531-22124-1-git-send-email-mingo@kernel.org> References: <1485641531-22124-1-git-send-email-mingo@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org E820_X_MAX is defined in a somewhat messy fashion: - there's a pretty pointless looking #ifndef __KERNEL__ define that makes no sense in the non-UAPI header anymore, - part of it is defined in api.h, which is not for type definitions, - plus it's defined in two headers and the main explanation is in the header where we don't have the real definition. So move it into a single place in e820/types.h and get rid of the !__KERNEL__ case altogether. Drop the smaller comment - the larger one explains it just fine. Note that the zeropage does not use E820_X_MAX, it uses the legacy 128 entries definition. No change in functionality. Cc: Alex Thorlton Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Dan Williams Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Huang, Ying Cc: Josh Poimboeuf Cc: Juergen Gross Cc: Linus Torvalds Cc: Paul Jackson Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Tejun Heo Cc: Thomas Gleixner Cc: Wei Yang Cc: Yinghai Lu Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar --- arch/x86/include/asm/e820/api.h | 9 --------- arch/x86/include/asm/e820/types.h | 13 +++++++------ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/e820/api.h b/arch/x86/include/asm/e820/api.h index 010efbceb40c..e161deb5736c 100644 --- a/arch/x86/include/asm/e820/api.h +++ b/arch/x86/include/asm/e820/api.h @@ -1,15 +1,6 @@ #ifndef _ASM_E820_API_H #define _ASM_E820_API_H -/* - * E820_X_MAX is the maximum size of the extended E820 table. The extended - * table may contain up to 3 extra E820 entries per possible NUMA node, so we - * make room for 3 * MAX_NUMNODES possible entries, beyond the standard 128. - * Also note that E820_X_MAX *must* be defined before we include asm/e820/types.h. - */ -#include -#define E820_X_MAX (E820MAX + 3 * MAX_NUMNODES) - #include #ifndef __ASSEMBLY__ diff --git a/arch/x86/include/asm/e820/types.h b/arch/x86/include/asm/e820/types.h index cf73c104c041..b05e812ff4f2 100644 --- a/arch/x86/include/asm/e820/types.h +++ b/arch/x86/include/asm/e820/types.h @@ -3,9 +3,6 @@ #include -/* Our map: */ -#define E820MAP 0x2d0 - /* * The legacy E820 BIOS limits us to 128 (E820MAX) nodes due to the * constrained space in the zeropage. @@ -31,9 +28,13 @@ * to allow more than three entries per node or otherwise refine * this size. */ -#ifndef __KERNEL__ -# define E820_X_MAX E820MAX -#endif + +#include + +#define E820_X_MAX (E820MAX + 3*MAX_NUMNODES) + +/* Our map: */ +#define E820MAP 0x2d0 /* Number of entries in E820MAP: */ #define E820NR 0x1e8 -- 2.7.4