Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp865981ybl; Fri, 16 Aug 2019 05:22:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqx03iL94JDGW5o6WGHdOAukE47p/xiaVlu1/0WnCFsRMGlETRf7Xipfl1D1ua0+l9i2nxHE X-Received: by 2002:a63:607:: with SMTP id 7mr7507000pgg.240.1565958138377; Fri, 16 Aug 2019 05:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565958138; cv=none; d=google.com; s=arc-20160816; b=N74J4XD11XNnGEnsEFAj3WqUY7mxYTOtrH5fN1SHby+Zk9WLC9pVErGQsD+DC3dQfd Ppx4sjEG92spiy5NpdDBDJQ7H3DwJby3bf1da9m3w0diR4eOBiCKaOe7UJt3fNJ0Xbn1 FbOQxhRJRRr/URAWhkq305W9PLxy1+wEGA7tKhUbRhBvs+O+WfNli6Kg/EF99ALw11R7 v2gpC0EeNz02wE1WwKamQzALcxUzKeDW6LNjFORciZDodsAsAaH8iGP73M4P1tuXVUu1 Fq2UtsAT1HbKZmQgDax/tg82dAuQv5GQByl3qAWNp8N769Mv+LLc1O9KMUJesUU86mC3 WZxA== 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=BrfH1XhTznc2zALCwGSlvffGTIizJp5vG62LuP0mI1c=; b=rwWi+G2V+FaJZzdmfQHsp+jQ4uRh07w+9OOkGEo9+Ankkfgm6zJxGi1XF2+KKyCxf+ HRxCTPXpozxa421H+/kIlE8CFfbJ7DvmmEhxDRf2aHMvka5VNkCk2VKw+cGR2ZG6U9R9 PonKImcS3LS/F4/SAMScDmOzzgDdWzc0+EHocqEpUZlzBFCsBOW7tOrHxryrxRDjrIPO tHR0rqDdGS796KMDp7knbC2FU/YxbKuSPsxK9wstgV4rsJwFmvisT/bMO9Ry5bNF7uow LeDQi/xHiOW11kSkgDgav+4CDLo1jbt9bQ8FL6SXIbrwiYMcELplNvRGQB/MtMUO1dk9 AA9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b="v/QFyJXa"; 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 u38si3805202pgn.79.2019.08.16.05.22.00; Fri, 16 Aug 2019 05:22:18 -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="v/QFyJXa"; 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 S1727256AbfHPMT1 (ORCPT + 99 others); Fri, 16 Aug 2019 08:19:27 -0400 Received: from terminus.zytor.com ([198.137.202.136]:47035 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbfHPMT0 (ORCPT ); Fri, 16 Aug 2019 08:19:26 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x7GCJAuQ2797771 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 16 Aug 2019 05:19:10 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x7GCJAuQ2797771 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1565957951; bh=BrfH1XhTznc2zALCwGSlvffGTIizJp5vG62LuP0mI1c=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=v/QFyJXak1RXek35qwjE5NnR+A+eUTKgoLHGovieUjkLWlFqZJo1AcwRv2dPUl2tc Tj8DAqdPymLwdP/RrNGXQu6b7S8euzo++MUZl1BEQK12QdQuWCjaoVZI454uGCiVQw iEP2rk+g9ev/xKeo368kAYOf5GwOqcwaPyaEoLoSZBDC3rDk/wSPJgjGVRC65qboEc gv97PKGs5Y3BrFh7h+6vbQ1hyHTi/JTgMC4ZS4qPqEiOt2t3wv2Klm0VekofWykyf3 L5nJK7eBzOIz5Q+jF3Ule5nP1Xngi/sRjt5e0LCwveKrINpS3qwcTOApdfJzkgwWnM HkBYK4mMH0kvQ== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x7GCJANk2797765; Fri, 16 Aug 2019 05:19:10 -0700 Date: Fri, 16 Aug 2019 05:19:10 -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: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, keescook@chromium.org, rikard.falkeborn@gmail.com Reply-To: linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, keescook@chromium.org, rikard.falkeborn@gmail.com 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: d5a1baddf1585885868cbab55989401fb97118c6 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: d5a1baddf1585885868cbab55989401fb97118c6 Gitweb: https://git.kernel.org/tip/d5a1baddf1585885868cbab55989401fb97118c6 Author: Rikard Falkeborn AuthorDate: Sun, 11 Aug 2019 20:49:36 +0200 Committer: Thomas Gleixner CommitDate: Fri, 16 Aug 2019 14:15:50 +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"