Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp41049ybl; Mon, 12 Aug 2019 11:20:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMViAdRU/Xa7yLAf7ybtryel327MmJxKTsN6VS3R2uCnpIz2fKZOhLFtMsO+4zxlJoeyYl X-Received: by 2002:a62:e801:: with SMTP id c1mr3048658pfi.184.1565634043706; Mon, 12 Aug 2019 11:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565634043; cv=none; d=google.com; s=arc-20160816; b=U2A75leD63xgdHw/6qtzUGp9IkNuwgeqjqImZOYsJwWtrA6AWieAOWmWJaAMsWSh/t 8LmXLKweY7yiGafSoyOaCKCnkW2fg8z680tNIbl1Eu84BGUhhRdQzSAjzjgq1sjtdKgT QVY5sITlvQXPiIc1lPy3kHBXtrhDiX/ZNTEe6Yis5bu19qY3qlguhB3+DudSsvtaiLn5 oqqb2EV7zy8FxJtSnup/isk+jI58rW728njGfsxQUzFCO031IOI27vJ6ztYI1pSm5Wrq 64/YJS+oHHZa6fll3wG5LjSNttt9i1BT43Ya8jb2Ifue7RYU1QjO1egZ/s1+JDIRt2FW 71Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=efP7XqhGzykMkOAX6h2fCl47Xp9KPIgLDTW9CGFRZYc=; b=1Fhw4nh9n4+2mnyKV7TOU/CYg5cWXm+3qTFQ/QkfNQ1vPWI2idSF1ZRKTj2Ps4iexV bd1vdKHef1AXI7DTQmkBXZvjh9FMGh9B/j/p3BXwzxN503VP2cy/YnHSJ5QvIZk28yGd FLI3wfbUdQbB+xuqoeCX95QL0SKpqb3IhasUNi2eKc+AMj9FgVAkULVaRvUHc84iVTST OoBsh6f3wH/TvqQjgDKHBhTBmnj7yxXnd6/285sIGfS4SFHvrieLOsZjMUFbEA64nZs6 WIcU7ZDJV7fBKyDKGYPkZcpy221N0MGuRAiTDbu/Z3zKzRwfx+fS91s7BA5HhgWxhgc7 hPXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b=mfq2CS4Z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si32253370pgr.103.2019.08.12.11.20.27; Mon, 12 Aug 2019 11:20:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b=mfq2CS4Z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726539AbfHLSTQ (ORCPT + 99 others); Mon, 12 Aug 2019 14:19:16 -0400 Received: from terminus.zytor.com ([198.137.202.136]:42959 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbfHLSTQ (ORCPT ); Mon, 12 Aug 2019 14:19:16 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x7CIJ44S1015897 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 12 Aug 2019 11:19:04 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x7CIJ44S1015897 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1565633945; bh=efP7XqhGzykMkOAX6h2fCl47Xp9KPIgLDTW9CGFRZYc=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=mfq2CS4ZoONKBOZA1/s+mb4POda0y/f5aeh4LcndUVzwTkXfb+JnKdNM9A1qeOUeh yJ837ckqZs6VH+zo17DXA2TUNgIBpsY7CV4RTPjbgSmyQ3rLynTnvP/oW8mESMqAbO 2RZN3dBr+H2noepQ15gxJlaK/n8hDbSgKBbrMtshjPDw7itueNmXwvWpYq8UiJ8lOI N5poWFPpz51zQxhm5IYdJcOfNElrsaYGMkYkEmHA4Tak5B2eSB/uAMq2D+N5whU60i OWGZkDQMqESEDmvCl7SA08E+s2yPxqJclPo8a2Pf3st9STIaOuN4XO9nI1j/aB1liy Ej5s1fg0Oj+Ow== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x7CIJ4m61015894; Mon, 12 Aug 2019 11:19:04 -0700 Date: Mon, 12 Aug 2019 11:19:04 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Rikard Falkeborn Message-ID: Cc: mingo@kernel.org, rikard.falkeborn@gmail.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, keescook@chromium.org, hpa@zytor.com Reply-To: rikard.falkeborn@gmail.com, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, keescook@chromium.org, mingo@kernel.org In-Reply-To: <20190811184938.1796-2-rikard.falkeborn@gmail.com> References: <20190811184938.1796-2-rikard.falkeborn@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/boot] x86/boot: Use common BUILD_BUG_ON Git-Commit-ID: f6fabe25f01cb09db51644780193f5ea6c44e04e 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 X-Spam-Status: No, score=1.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, FREEMAIL_FORGED_REPLYTO autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f6fabe25f01cb09db51644780193f5ea6c44e04e Gitweb: https://git.kernel.org/tip/f6fabe25f01cb09db51644780193f5ea6c44e04e Author: Rikard Falkeborn AuthorDate: Sun, 11 Aug 2019 20:49:36 +0200 Committer: Thomas Gleixner CommitDate: Mon, 12 Aug 2019 20:13:56 +0200 x86/boot: Use common BUILD_BUG_ON Defining BUILD_BUG_ON causes redefinition warnings when adding includes of include/linux/build_bug.h in files unrelated to x86/boot. For example, adding an include of build_bug.h to include/linux/bits.h shows the following warnings: CC arch/x86/boot/cpucheck.o In file included from ./include/linux/bits.h:22, from ./arch/x86/include/asm/msr-index.h:5, from arch/x86/boot/cpucheck.c:28: ./include/linux/build_bug.h:49: warning: "BUILD_BUG_ON" redefined 49 | #define BUILD_BUG_ON(condition) \ | In file included from arch/x86/boot/cpucheck.c:22: arch/x86/boot/boot.h:31: note: this is the location of the previous definition 31 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | The macro was added to boot.h in commit 62bd0337d0c4 ("Top header file for new x86 setup code"). At that time, BUILD_BUG_ON was defined in kernel.h. Presumably BUILD_BUG_ON was redefined to avoid pulling in kernel.h. Since then, BUILD_BUG_ON and similar macros have been split to a separate header file. Signed-off-by: Rikard Falkeborn Signed-off-by: Thomas Gleixner Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20190811184938.1796-2-rikard.falkeborn@gmail.com --- arch/x86/boot/boot.h | 2 -- arch/x86/boot/main.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index 19eca14b49a0..ca866f1cca2e 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h @@ -28,8 +28,6 @@ #include "cpuflags.h" /* Useful macros */ -#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) - #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) extern struct setup_header hdr; diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c index 996df3d586f0..e3add857c2c9 100644 --- a/arch/x86/boot/main.c +++ b/arch/x86/boot/main.c @@ -10,6 +10,7 @@ /* * Main module for the real-mode kernel code */ +#include #include "boot.h" #include "string.h"