From patchwork Mon Mar 4 17:50:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 159566 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp4037474jad; Mon, 4 Mar 2019 09:50:25 -0800 (PST) X-Google-Smtp-Source: APXvYqyiqibfnHBkxZQL788dtGOFTWsOwgnJ5CP+/Mcu8WQuR9FrKV+Bedn3st+hfWn4Vyqm1rDD X-Received: by 2002:a17:902:b402:: with SMTP id x2mr21405345plr.53.1551721825351; Mon, 04 Mar 2019 09:50:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551721825; cv=none; d=google.com; s=arc-20160816; b=Xpe3gc41IszPDaeRpDpCrxz9ayv8E+BkT5nDROMeiw78DR1O44z8nfVNdIoddGbDss upKDEFMptaJMFYIoxmsjqvkRk0hHquip2FRmlLohFntFp0or7X+VHpHv6bw0y9Ohbq0u ka6Q/ljHh+e/99UAbQuGcp3t/7k/oeLNM1cbk2alhie/UVltH3NUl1dkmTqSO8rqj5dz WNvipZSvtRo2sqT7frtKVeNo2hgZiskgQcnfAZi/k9D9kc/w2u64QdUE81i9f78mqvjS tjALGUoHG4lNolnzPDcEU49eSwGZ8QWNwLtFU5QQiCn8v5llVkhRF+T+0Rb61U58q8iS 5fYA== 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=hMt3tGFDbLeDDehwajzyxAk4kYu7hBgZncEeRwthfXc=; b=Tm0/AukPecuMQRVjG2ZJpblpfx4uxwAYOAhGIsWtA//oyAeG/8HNlf1tOtK4Nb0+kM 3mI647DWZXMWJqx0XQR9XBoLe580QA32sBq47AdWY+QeEktKFoIKSspHyl6DW2qu3vTx 9zYJ7LHS5FLCWA8T0KyvGYpUvT5AxyjhquHLexvVBvLE53KRuD8oa/uigHoQOgXCbr7y kKGZFxQDdgJS55RDerRCplIUksH0v9VzLnDGTszvGdyTFSpBxgmqzf6pz0uiasWbrNrz 6z6rK34wUda3u3+YQRdDsJ2p3fuXpnvipLWxrFS0MNA/CZSvj0+j+Ow8KlLEFLworaFk nkyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=A6PKJ5Q+; 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 f8si5489539pgo.80.2019.03.04.09.50.25; Mon, 04 Mar 2019 09:50:25 -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=A6PKJ5Q+; 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 S1727482AbfCDRuX (ORCPT + 31 others); Mon, 4 Mar 2019 12:50:23 -0500 Received: from mail-pg1-f202.google.com ([209.85.215.202]:52023 "EHLO mail-pg1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726181AbfCDRuX (ORCPT ); Mon, 4 Mar 2019 12:50:23 -0500 Received: by mail-pg1-f202.google.com with SMTP id 73so5566864pga.18 for ; Mon, 04 Mar 2019 09:50:22 -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=hMt3tGFDbLeDDehwajzyxAk4kYu7hBgZncEeRwthfXc=; b=A6PKJ5Q+MOWvmDi+M87ZYp16ltg8tDaOfNw4b2eNTcxt6/kvNcGE+sceFFzAo+OuPs IH0k8WBHOqUyc5YnMogMfPgURFnZYlG4R0nHuCloXu595A8/4RmxewlCcVevWIvraLl+ cb9sRaeFCHDyARs8a8S14IE9y+dceqzuhqd+E03z/dbrlskwhsvKw/ONkMaYsEdHe9+V a7EjdvOIgWLnixauFagt3LUZOL99X9ajz3vjNxlmA6gINhOx3oQO87QnQmazMx7+RykW 8fh8nDn+nB0JHHfJb/8KnYCBYIH4Q7kX735EAlpwoyB3z036U88eXLdl8jhtnfNLJcd7 UP5A== 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=hMt3tGFDbLeDDehwajzyxAk4kYu7hBgZncEeRwthfXc=; b=r/b5AOtwG6znnAMJD2yRccrdNpb1y9FhoaAfZUEEt2oVM+m07CJNXnAr0/CWuERAk3 leiZHuGY99wlbiLIJGJ7H66WHs6H3RJaNkirqgz1Jbza/5ZTdm/DxZ2s/jRUA4miOnuL /ZcbD3vAz7Yte+gtp9ts7r5FvMq25R8nQAr867H/wB22ZLRH1a7xFR6YzSTkUbGlyTcI otv99TPcW/9dKWQ04+zkIevmrvDjWYpWGBhqQHgaHQYkBbM/d6XwF6hI3uXq45c8nRJu ZtXXC6XYgj0pXaha062p+8Q8REmt6M5u/OThum+N4xRjxLkKK8aPo0NIRsWWba0hhtYr HH1A== X-Gm-Message-State: AHQUAub3M6ca+QLN8g8i9EDSNvH8ND24l3McMuD7YS2xAKlRsoeWa9F9 NeFdsGU6LplC6iQbMsRtFno2mmzFP/Fe8NbUZrw= X-Received: by 2002:a62:fb03:: with SMTP id x3mr7641257pfm.130.1551721822190; Mon, 04 Mar 2019 09:50:22 -0800 (PST) Date: Mon, 4 Mar 2019 09:50:16 -0800 In-Reply-To: <20190302132750.0916adc4@canb.auug.org.au> Message-Id: <20190304175016.40538-1-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190302132750.0916adc4@canb.auug.org.au> X-Mailer: git-send-email 2.21.0.352.gf09ad66450-goog Subject: [PATCH v2] 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 V1 -> V2: * Add Reviewed, Tested, Suggested tags. * Drop linux/types.h; it's included in linux/limits.h. My original intention was to unsort the headers (sorted in V1), but if we drop the out of place linux/types.h, then we can insert the two more specific headers in alphabetic order. arch/x86/boot/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.21.0.352.gf09ad66450-goog diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c index 315a67b8896b..597589cafb45 100644 --- a/arch/x86/boot/string.c +++ b/arch/x86/boot/string.c @@ -12,9 +12,9 @@ * Very basic string functions */ -#include -#include +#include #include +#include #include #include "ctype.h" #include "string.h"