From patchwork Thu Mar 14 22:14:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 160366 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp16035986jad; Thu, 14 Mar 2019 15:15:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+6hjBtbLBKES22bA1aAk+uwCCSD9n4HLxgwjArzUesvtmwnGZj7qgGYqThejxFJPIKYcd X-Received: by 2002:a62:12d9:: with SMTP id 86mr564259pfs.214.1552601714216; Thu, 14 Mar 2019 15:15:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552601714; cv=none; d=google.com; s=arc-20160816; b=zi08rvtkmaPhLOXfcYuPtMtw8dRqDuyTE/xGC9bz/RnvNoopNegIlopxeSKKEaHX2g usbJ1Rrd/BYOCeIIyd4NNoikf8wf8cPW8rF/FJtHSv9PD19pbaGX96OrgT6Sy65Ll5no I20Rb7gx6455sQrNiKJV8D3xjgK3i/u34NOSc1EKEGMvPRKx2BgdDoMbo+AyZ1rmRnHq o1DbMKAFGHjCK12E3fwWVzplMqXre8eKYw1PX8wP0D4sguxGvEHII1UCESko8DC0ATvk LDI8WxjkZ0o1Mw/+uw5V1uPVRrjDktoKxnQxhHNhlKYOKt9rBtuyDMdLInM8skRh38od 9TYQ== 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=a0Z+F0fmFULDIL5rprNh3E5BB87HBNzyaQEazZwo8Qo=; b=o5BvZtxexiOHNgq/47gASCaS/sC+o+dF3IZgGuuM1VFB7vOwKFxXPk0xXGthxSov8c FyKBCsuCFr4dMphwwr+7tbQ1K0b1KBHOfG2zzVZ5YIhwwy2SkZ/N6CzMR2RaFAvV/3Et pwjaiBsSAe92nbiFn42mYOwfAE1ZAdYjflCXi8iVcCLxIZsbYxXMg0FYzDMWwmQYZh2i 7oH/SHsKAlDsIFm9KMW87NRya3Q0InW6c98inETknH91iX1UZKrlDO0g7U6FQYNgjjhA woh8IUrALjQd5U9+y1crR4fNBd6f5K3qcZC2phDojXYGtrprjlTDJCtAs0nsYIaP8I9A 6FHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ezyo80UF; 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 f59si47498plf.158.2019.03.14.15.15.13; Thu, 14 Mar 2019 15:15:14 -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=@google.com header.s=20161025 header.b=ezyo80UF; 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 S1727633AbfCNWPM (ORCPT + 31 others); Thu, 14 Mar 2019 18:15:12 -0400 Received: from mail-pg1-f201.google.com ([209.85.215.201]:34038 "EHLO mail-pg1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbfCNWPM (ORCPT ); Thu, 14 Mar 2019 18:15:12 -0400 Received: by mail-pg1-f201.google.com with SMTP id z14so7843063pgu.1 for ; Thu, 14 Mar 2019 15:15:11 -0700 (PDT) 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=a0Z+F0fmFULDIL5rprNh3E5BB87HBNzyaQEazZwo8Qo=; b=ezyo80UFCqF77L/UIQxJ158UXxq76PaoXjEMckKTRveE72ftF7nAsQicf+Bl2pscg7 CKg4CHZE5cGPVOrG4Q4zRmvz2e/RfXxj9QberpSCQ1WQxdNTaHdt+b3ia/F04nMygpK1 dylUAO/Yh1nr52563Hx9Jleo0Brv3/+hZet0iZmGBZ378pP0vRjdHh5yqG3I7Xrg6O3o 9N75eQ5p8t2fnMsgH5+j5IcTEJ7DwTqR43YwgDhuyfnOyeEK8RIkvu8mDAF7yRxykJC4 i58pfCrF4djBE5ZefEq68LIAizmZoLVNYbJ2x2boj6t39bqKNFzd4ct10GP9RkYP9siC rQQA== 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=a0Z+F0fmFULDIL5rprNh3E5BB87HBNzyaQEazZwo8Qo=; b=loz3TeYmHb+xD+qjRo2sYH9u5KVRJGdQIzkXnpN/PwidKgRJO//whSOSGUs7lpNcIx 7jc84YfkYKx+KS2STKnKvXdEfuYCiYrXo5zaJ7DUzt/xt+3cpazn83/MXDT612sPFu+d Vjhdx7lW/neNL6mu5nVGU4JIiBP9hORV4DLWpnBSGRCdIejApwULWx6tLavQW33tR3J0 +kCFm1/pf5mPg2W81uz+bz70QsdTfQDgu9gEXaa9JF1WB0n5XQ94793xfr2Th0etSBIb nr08Gr9wCh1VZQtvsGGsOzcwqNaZQ+3F77CT0QF8K28bglqfaaaE2VDCQltWG+TayACq Swcg== X-Gm-Message-State: APjAAAVF/1tqdJskhyMsEAYB5caJpynv5iGXRryae9nPL8VfmMvmbFWd hOEL8et/5Va9ak4U18JtnU0rFbGP1ks9EGrliHk= X-Received: by 2002:a62:1f12:: with SMTP id f18mr310434pff.49.1552601711421; Thu, 14 Mar 2019 15:15:11 -0700 (PDT) Date: Thu, 14 Mar 2019 15:14:57 -0700 In-Reply-To: <20190305085707.GA8256@zn.tnic> Message-Id: <20190314221458.83047-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190305085707.GA8256@zn.tnic> X-Mailer: git-send-email 2.21.0.360.g471c308f928-goog Subject: [PATCH v4] 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, Chao Fan , Uros Bizjak , 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. 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 V3 -> V4: * Drop sentence from commit message about sorting headers. 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.360.g471c308f928-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"