Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2941631ybl; Sun, 11 Aug 2019 11:50:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBzhCdMZSgcLLMN3t0N0ZehgsGxnLZpN/QRgtdVaYpYaf9VIm3jiX3l3mhlagKm1oZMy7s X-Received: by 2002:a63:2043:: with SMTP id r3mr27131953pgm.311.1565549450466; Sun, 11 Aug 2019 11:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565549450; cv=none; d=google.com; s=arc-20160816; b=xkikWRmmDfrNyuKjDuFmozqlGao2gvBua750noiWesVuiK+x5xYlpO2jhYQR3i15D2 z67YzU7LGevb6O0GtWbNXOGz7mG9HYQm7Xdgd3zvihOFezJVK+iSZg068VdAS6Eb0mmf AEZ4J9xdEMRnXsIOhG7hMlHtwTE9WvOwsM2Rds60Em1ExvvJE9g5tSXoKhbJRWDMdeh9 BYKYvHbVxcctjn+jRv17uxJ3sZ/Eq024bmlg2jXffdH/hXy58p3W50TK8+tUI+EsBWVH LVQ2WbM67xYGZEG9ZD/7rwEKhBK5OHIDlrQ1xrJWqRkGbifr3eGR1GljERXxPS10qxRc YSiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aAzxUIh+F3vyPVqhjFc/DJxcezBxry9v7OnC5t1hVac=; b=Jol3jtJr3MZggKG/flVv7LyXy8xz9wbUYTZLcZTBMCmVYTBC3UPu96gNAc9B80ESMz U5/TPBdM/YuHYz51VAnWtsz6esAC+ClQg7gfv/4VQu3IgAHaXGfM1ZtriTHcDXn7kCQd YEF/TRoiHF0fZdVL2WsRM5RoaVpdezeWpWP9cl1Ukd/0s57OI5RhMQw3AxjvXIWiU5dV MSLCD0YSR01U8dMf5NPKbkRG/cs16Cx2+mXViwy1H8rNFo/UCT5NKIpJZjNCPO1NBa8g 1E2rqXH96+PcBRClZMC2FcIsgU+5QdfK4J2M4Wdxu1E+ChqP97QTMhfj9RrNzFcWNTLv TGCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=plMzkZ2Q; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si10025639pjo.40.2019.08.11.11.50.35; Sun, 11 Aug 2019 11:50:50 -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=@gmail.com header.s=20161025 header.b=plMzkZ2Q; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726477AbfHKSt4 (ORCPT + 99 others); Sun, 11 Aug 2019 14:49:56 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:42198 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726011AbfHKSt4 (ORCPT ); Sun, 11 Aug 2019 14:49:56 -0400 Received: by mail-lj1-f195.google.com with SMTP id 15so4676338ljr.9 for ; Sun, 11 Aug 2019 11:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aAzxUIh+F3vyPVqhjFc/DJxcezBxry9v7OnC5t1hVac=; b=plMzkZ2QMZblSXmGPP4mHFOaGUWc5TWrDtPJ1limo7EGe6D/+1jgDfPpiVEBQ+744F 7hSqoU+53D03QTvqToghkFYT2ewGvVxFNpVkmnjcMP49UrhEkR8nn062JYJnF89hWlll xAdNyM//p+WX6Uu/OIxi2wJcQO/T9QDgdvmEFsmZyOBFpdXPQm4uBECnVYXi0XLkxMrI 2TibcHrL+PNc0kMV0S4+IZOwBMJQcB0i9zrHkWQh81oeM06X/jJZGryAltsQplnG5jJ4 KGGQExadxrZ2WywvA/999Fm6i+mntOmaRKHIN3aJQgZgMvW54Te4uA2xPoCLqPM3iSYj 7BgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aAzxUIh+F3vyPVqhjFc/DJxcezBxry9v7OnC5t1hVac=; b=Km9KmwywRwyp2uOs+kFEDO8Ca2YU9yFYJS3x6wrDrzt0TdHTK1WmeGhukG2qyMswht e+94339Zvl7cfE5OyS0r+wwtLtI6cnTBpNpIESmoTZtFYrw+ApRQ72m8PxSa0jtlO64S g5gZGNxfAvHiBDSSFJKKL9RBtF5+DxybPFvMbr8G8J93d3vWqsYSYFohCC3FbicNp0yl 8969cTYlAACAA2iI8MEyhQY6X9/5oNq1yq1i5E8FYpEpAspZ2O684fsFylVmEzlaRx4p QdSUMBvBFI7urEuJIpKTYmkT0jSVAZKdUNXuBPraF2QPnIqvnB/MDmaNnpUU77fKenTY KU+w== X-Gm-Message-State: APjAAAV8tmmX5wKe3xVPZn7isDzHD7BEp8XmphurVeyZFla7Wv9TL+ON XGmz2PQoEzmqfoKzLow5E90= X-Received: by 2002:a2e:8986:: with SMTP id c6mr8823621lji.59.1565549394387; Sun, 11 Aug 2019 11:49:54 -0700 (PDT) Received: from localhost.localdomain (h-158-174-186-115.NA.cust.bahnhof.se. [158.174.186.115]) by smtp.gmail.com with ESMTPSA id r21sm5250117lfi.32.2019.08.11.11.49.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 11 Aug 2019 11:49:53 -0700 (PDT) From: Rikard Falkeborn To: rikard.falkeborn@gmail.com Cc: akpm@linux-foundation.org, joe@perches.com, johannes@sipsolutions.net, linux-kernel@vger.kernel.org, yamada.masahiro@socionext.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Greg Kroah-Hartman , Allison Randal , Enrico Weigelt , Jordan Borgner , Kate Stewart Subject: [PATCH v3 1/3] x86/boot: Use common BUILD_BUG_ON Date: Sun, 11 Aug 2019 20:49:36 +0200 Message-Id: <20190811184938.1796-2-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190811184938.1796-1-rikard.falkeborn@gmail.com> References: <20190801230358.4193-1-rikard.falkeborn@gmail.com> <20190811184938.1796-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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..c5e55d2c55d0 100644 --- a/arch/x86/boot/main.c +++ b/arch/x86/boot/main.c @@ -13,6 +13,7 @@ #include "boot.h" #include "string.h" +#include struct boot_params boot_params __attribute__((aligned(16))); -- 2.22.0