Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3556035pxb; Mon, 16 Nov 2020 19:03:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDXcGI3VbBq2WoGcfkemVCUYrNg2nCYhzZC/45txHjKV8Alc6R4JUOVLuNnKCG2iIIngPl X-Received: by 2002:a17:906:b150:: with SMTP id bt16mr17849113ejb.257.1605582220296; Mon, 16 Nov 2020 19:03:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605582220; cv=none; d=google.com; s=arc-20160816; b=pLSn72pc/bPmE1flCzHpXvjDHxc3fcw2QEpFAxk0wZ+2Y8JhtzehxzarPsbikVpuit bwS/TAibj78nb5ZDnyw7ChCyRvh+XikVyxp92mkpRRtq2u0NgHNhuWjLhIFOzVqu1juN 7Bb5tvPGCqiSlKHsJ1DnrXsdyY17hf/DotJfnP1rQYz5iyfvDpM1qHa7gBHqk0BwTUva 95qSm/02p/EXHbLorG4xuu/xGBpGXL2mLHNb3IbH7GoKFrXLAG74eQY80hQYYePC88wx OP/IK0Obb6x/Kgmc8LlBIkjWZFUx6VhrF04c3/NrgQ3GuverUlfUfFGM3Lpln7Jkr/ws HyOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/RX5/tcWvfpmbLMRcPAk9O2TQzIviRgD54vpKLoaWpo=; b=NM/Fb1PLQZqpPkRVBiUS1Vnfxv5d+UuRPfpmrp9UNly9/4Dq0M3xJva2cXkqmDe89S SzUYVetsvY+IJZHW0cuztJYWrBYfFyXWQoVMJianEhz91EmdlHWUm7cK9rKqMh1cQAFe Dr8En6goJFTfzQe07XtJWPiNUmoLm0Iqd99T2VJYfmaUj7xJXERno/kFrukx6iV8qAKH sgTm1v52mwUZP81UMRZiGpj09w5dTkB4rfriB9FnC8wsMn67D/JQDucKCX4c3KezRqRL mZ8F4de/UMBoShs1LEAKKrU1IaibpcjRcKgrRV324ghhJsSAG5NvsFh/zQgiGAyi7Zni 6YhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hE5VawGm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id v5si13246694ejy.703.2020.11.16.19.03.17; Mon, 16 Nov 2020 19:03:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hE5VawGm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727152AbgKQDCC (ORCPT + 99 others); Mon, 16 Nov 2020 22:02:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726625AbgKQDCB (ORCPT ); Mon, 16 Nov 2020 22:02:01 -0500 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87B33C0613CF for ; Mon, 16 Nov 2020 19:02:01 -0800 (PST) Received: by mail-qt1-x843.google.com with SMTP id v11so14684422qtq.12 for ; Mon, 16 Nov 2020 19:02:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/RX5/tcWvfpmbLMRcPAk9O2TQzIviRgD54vpKLoaWpo=; b=hE5VawGm0ZXhtyP4Qnc7smJ9fE0kivKCkJDRbzIgQpVCbM7l5C1yAgEGuAzk6a2mUt PIEEM7AXFJ3WKNkh9hw4ZEp9O/i/dDJQu+jH6yn3Fq4LQAF0Kt4D9oczRHO6/qUwCEkC QZxbdKwknqfKqBYFXPlvqJZ0hI1Y/aWUecFc7IRAwp236qdqZ3SRP3ZrL58wsGTHgowe GJz4eC7I9upCGh16Dniv0Wpp2wqb+4I4w0Ar6eqYqqA6LkT/zkWvEy29BwXpGYkrlk4a C46XndyIAaMhe78TeusGoMt7gF50hWn1UozXFop/1pI0JlZmsxnH4cWyolkhpXMwxMhg DpUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/RX5/tcWvfpmbLMRcPAk9O2TQzIviRgD54vpKLoaWpo=; b=Qv8vMRRceCHZ4DptzI0Gaz+l2uCGHbljRrG5IyaeLA95ZbLhbYy4F+K4M0U173nnA7 kv3x1vYtsEuM1VK3G7Y692Qeg6tOMyQIbmDRdf2XucxrcfSc/LP2E5tYW1tNAZTSUa1D ql83qE7afQpy625uqP8m9jkK4mFzvItfTBayhCxrmkuMGq92d+DmrKcEKN3E/opO2+Wg VQLaflFZWkdXnd3FyZ5hRVvrz+flaSUJNJj67YM7Lgqu6MAS6edX5wTAx+uJmN2NOyKh joGpadXE1Xg8pixReHzaNLOfEYkB1IXjl+wNjBl1V6oA1C+vlDyNcG1y0KKYqkGcw4T2 Au9A== X-Gm-Message-State: AOAM531BsJnxVothMZ//wbIuLKcumHl3efcZAAC8iF9WpQjmqB6Vtw4U itoej3hfaCEdA/bs1LNvdas= X-Received: by 2002:ac8:7081:: with SMTP id y1mr17205582qto.72.1605582120723; Mon, 16 Nov 2020 19:02:00 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id o63sm13359774qkd.96.2020.11.16.19.01.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 19:02:00 -0800 (PST) Date: Mon, 16 Nov 2020 20:01:58 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: "Gustavo A . R . Silva" , Miguel Ojeda , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , clang-built-linux@googlegroups.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] powerpc: boot: include compiler_attributes.h Message-ID: <20201117030158.GA1340689@ubuntu-m3-large-x86> References: <20201116043532.4032932-1-ndesaulniers@google.com> <20201116043532.4032932-2-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201116043532.4032932-2-ndesaulniers@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 15, 2020 at 08:35:30PM -0800, Nick Desaulniers wrote: > The kernel uses `-include` to include include/linux/compiler_types.h > into all translation units (see scripts/Makefile.lib), which #includes > compiler_attributes.h. > > arch/powerpc/boot/ uses different compiler flags from the rest of the > kernel. As such, it doesn't contain the definitions from these headers, > and redefines a few that it needs. > > For the purpose of enabling -Wimplicit-fallthrough for ppc, include > compiler_types.h via `-include`. > > Link: https://github.com/ClangBuiltLinux/linux/issues/236 > Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor > --- > We could just `#include "include/linux/compiler_types.h"` in the few .c > sources used from lib/ (there are proper header guards in > compiler_types.h). > > It was also noted in 6a9dc5fd6170 that we could -D__KERNEL__ and > -include compiler_types.h like the main kernel does, though testing that > produces a whole sea of warnings to cleanup. This approach is minimally > invasive. > > arch/powerpc/boot/Makefile | 1 + > arch/powerpc/boot/decompress.c | 1 - > 2 files changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile > index f8ce6d2dde7b..1659963a8f1d 100644 > --- a/arch/powerpc/boot/Makefile > +++ b/arch/powerpc/boot/Makefile > @@ -31,6 +31,7 @@ endif > BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ > -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ > -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ > + -include $(srctree)/include/linux/compiler_attributes.h \ > $(LINUXINCLUDE) > > ifdef CONFIG_PPC64_BOOT_WRAPPER > diff --git a/arch/powerpc/boot/decompress.c b/arch/powerpc/boot/decompress.c > index 8bf39ef7d2df..6098b879ac97 100644 > --- a/arch/powerpc/boot/decompress.c > +++ b/arch/powerpc/boot/decompress.c > @@ -21,7 +21,6 @@ > > #define STATIC static > #define INIT > -#define __always_inline inline > > /* > * The build process will copy the required zlib source files and headers > -- > 2.29.2.299.gdc1121823c-goog >