From patchwork Tue Mar 5 00:12:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 159626 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp4360120jad; Mon, 4 Mar 2019 16:12:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IZL/xwdWvX4Sy6p/UmsFu0BO8Tl7c5WbQYZ5YKoRFuBQvDLp9Sk5WeTtoA+07H35Xiif0QP X-Received: by 2002:a62:f5c8:: with SMTP id b69mr22331365pfm.128.1551744753892; Mon, 04 Mar 2019 16:12:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551744753; cv=none; d=google.com; s=arc-20160816; b=cUVvdOYN5nHiBlbLMFCQIqst+EYVvlcF/7fcgETO3SXjXkXzl0qY/E4VSEH6gqsbpj xRyk/Zv++9W5tLNqqQTAdHViTFN65LKZfFJZVVXoHA7ODs6Hxl9HPzIeqJOmrOkGgb5D krbInzIuGbNoEaKcsbYIDSdxqrvUzvfch+Hi33Xz1ZW4lsDCp16rV+NsT3/bOOMpbcyZ nHOXAAv//6HvK/eit7EMk7n5Tfi15Zt9ejmACptevbu+GTSmShnLWjC19yAo2d1hGLvV fKAO6Eg9sY7zOO5y8wn4MH5AViBmOrm5/2iEffEMhr1kE8v1vTKybXI3MMIncrvnkZ9u YBhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=/Xv0gLmyX/M+BKDNKE9MX0hf2Mb0FZUgj80Ns5OPor0=; b=BILXO5X3RMWBnxiwfTujiryM2AUu+/4zIw+d+zXbI7ApBvdvcxFVi2vbz69+D5pwnJ 6WAAC9tZtpZ2Bo934LE1+pFOgugF4g4NQlNMjIhGNjbhzCQCzMFv3yMIOhiu2wfAvoRH cBxVyFTAnAf6pow0GPyaNIqhqNwEPNz2W1wlTiYj3tRU1vxb/e7sbE29tZ3huHpJJYYP VSFRa+FVCiJSIY7srMGHvBYL66C2kKD4AQwrrw4YCD+3pF5ALn96fYo9sS13rP2Pi8AI 4VicP80QvJQMEXjl1p/oTA09BmkAcEtKd/C+uqRUMPPxCrsP7X0FKUSAQS0jaDwi8yGH Y0fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Vvlax/fc"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r203si6352851pgr.517.2019.03.04.16.12.33; Mon, 04 Mar 2019 16:12:33 -0800 (PST) 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=@google.com header.s=20161025 header.b="Vvlax/fc"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbfCEAMc (ORCPT + 31 others); Mon, 4 Mar 2019 19:12:32 -0500 Received: from mail-yw1-f74.google.com ([209.85.161.74]:51979 "EHLO mail-yw1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbfCEAMb (ORCPT ); Mon, 4 Mar 2019 19:12:31 -0500 Received: by mail-yw1-f74.google.com with SMTP id l11so10532546ywl.18 for ; Mon, 04 Mar 2019 16:12:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=/Xv0gLmyX/M+BKDNKE9MX0hf2Mb0FZUgj80Ns5OPor0=; b=Vvlax/fc6Pr+QsVm1bDw9IjzaM2+9KjOVKEXfPxTdvx/rAuQiNSyGwfBDFQ5dHiqSQ uiRGs8m9VHlLn27tf+U9TY9+wqCjYzb8PXy6UJkigNDUcQoj4F9QTXBzS8OL5Z9Lny0p pnGc6brMT+V/oCfbCPaDa4USOwY56bkErcCG0EIkavTycGloVi9L81LucMdtWis4ej+Z W6GrRFqXzdn0luIMZrx7kRpTya3hwco8U31i12nZdCKoeyX0eT6eK8/SvaQ2NtK+ZWy9 EkwAnbQMFlx+BnRvlXAc+tjKcPiUzsTfDw48PxPmMwx0lFfeD4Hv63Bm2nUTcYZhzTog Oh5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=/Xv0gLmyX/M+BKDNKE9MX0hf2Mb0FZUgj80Ns5OPor0=; b=GVor8g8twF3sWlbDbG7i6SnnTqakvDz0Ytehbz7Ch0tH6pH1yoi/vaKC9hsnyNaOIw v4Y71Fj20Oe04McpWIhlR1FiiViMAkEd+yqHSlFaFNnPfIpqUoJWti5hbkiG96fSYiKJ KpqZ2jQNacXcQ+e/iVF4Qym4C75sxWm2abrYnZ4jdW6ZbJ3YZuydYCq0Iq3ELJBDsWNE 3aCo8I+sGaagYkYyxgBgfyNK3UWDvF6su5kbOSRiH2i3sc68jcgjsr1j4IrI9J0ra2my 0fgNGQVZd96QXNi+JZWTcU8gwZT8Z1ZPLk+KytYlAEVW2u/pCALLJurTx73FpxZEEUWc 8gSg== X-Gm-Message-State: APjAAAW7PNKt9DPsT+GmPkuPEFFY66D3DvnTDZpGA2ZnHJzkyAlsOJSj DGASfMGd6lQpvgzcCX4ZffJeYFdJ8rjpRUq4dPs= X-Received: by 2002:a25:3249:: with SMTP id y70mr23915yby.70.1551744750439; Mon, 04 Mar 2019 16:12:30 -0800 (PST) Date: Mon, 4 Mar 2019 16:12:21 -0800 In-Reply-To: <20190305095100.243a40e3@canb.auug.org.au> Message-Id: <20190305001221.31343-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190305095100.243a40e3@canb.auug.org.au> X-Mailer: git-send-email 2.21.0.352.gf09ad66450-goog Subject: [PATCH v3] x86/boot: clean up headers From: Nick Desaulniers To: bp@alien8.de Cc: natechancellor@gmail.com, niravd@google.com, sfr@canb.auug.org.au, Nick Desaulniers , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The inclusion of was causing issue as the definition of __arch_hweight64 from arch/x86/include/asm/arch_hweight.h eventually gets included. The definition is problematic when compiled with -m16 (all code in arch/x86/boot/ is) as the "D" inline assembly constraint is rejected by both compilers when passed an argument of type long long (regardless of signedness, anything smaller is fine). Because GCC performs inlining before semantic analysis, and __arch_hweight64 is dead in this translation unit, GCC does not report any issues at compile time. Clang does the semantic analysis in the front end, before inlining (run in the middle) can determine the code is dead. I consider this another case of PR33587, which I think we can do more work to solve. It turns out that arch/x86/boot/string.c doesn't actually need linux/kernel.h, simply linux/limits.h and linux/compiler.h. Include them, and sort the headers alphabetically. Link: https://bugs.llvm.org/show_bug.cgi?id=33587 Link: https://github.com/ClangBuiltLinux/linux/issues/347 Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Suggested-by: Stephen Rothwell Signed-off-by: Nick Desaulniers --- Changes V2 -> V3: * keep linux/types.h Changes V1 -> V2: * Add Reviewed, Tested, Suggested tags. * Drop linux/types.h; it's included in linux/limits.h. arch/x86/boot/string.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.21.0.352.gf09ad66450-goog diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c index 315a67b8896b..90154df8f125 100644 --- a/arch/x86/boot/string.c +++ b/arch/x86/boot/string.c @@ -13,8 +13,9 @@ */ #include -#include +#include #include +#include #include #include "ctype.h" #include "string.h"