Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1201863imu; Wed, 28 Nov 2018 06:12:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/VPvIhwlHjCWkty4u1SzxyOmhvWCBDOoQ5P+fm2Fw0U8nWC3+BAK6BFxdKasHQkpVHK1AHC X-Received: by 2002:a17:902:9a02:: with SMTP id v2mr37821795plp.180.1543414362413; Wed, 28 Nov 2018 06:12:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543414362; cv=none; d=google.com; s=arc-20160816; b=nftqpGuElQiTYu2NNAMK7n7KVpLQoUR4INfqCxidMmZcVGZNgNkA+6O1NLMXCDNtLQ 9quasBM8xgFdi7+qBknAQ59vh6w9Q0ix9c2yUwQ8Eo80ipcH0Kyeaj2pdzl2FGQ5xX3G ygtgowyVMwzR5jseysENSWi+ffA+gn4TCVrHr2+b9WN3fBhdIg0buu98Y6k3+VrXvWlY skiOaFsDopB61uH3LQhXcHthNNHJHjQtuS5Nh0HGnCP039Xfk1p+YUjzAKr3UFCg73/y 9I1wpiPIvB/ud63TLzlxl4EZyR10XKt+RiHMdgiIDEwD56PbNALcqDsJqyjKuL7WQXcQ o7HQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=dTSwJN4JRQVZ+k0IVkIDcn8Xu4jKAMDWHghpT1s4ppk=; b=b5p+LDUmV2uXrKcZrpIPk6er1dbvjhtzImPIBHKGEtoNEnBdUrP+dcZkL79GcyqmmW yd07DhDB40WmdfOIeogGnw2GtFValk68vNJ7z2y1YNvP8qK202FjbZeupQNz2+Z0zOo9 PN3xsGbCGIXXfuqDgQd1paCYzOoKznL/flEcTaFDq03dmpuF7GOMyZ80FOTLhfBqIBX9 A4fFWngULKYvNlEVKzUiuiMFbRtrxythQcTFAQJPFo9F1fWUtJxAKy5CRiWkFVc3vDar BCPGwOyispuhI+AS5uf0KhNVK6nlwquoeyMDcLTa6qxWJGzU21ttUt35yE3XbR2MxQew 9ecA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=G1X0coXb; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si7115261plo.247.2018.11.28.06.12.25; Wed, 28 Nov 2018 06:12:42 -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=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=G1X0coXb; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728262AbeK2BLX (ORCPT + 99 others); Wed, 28 Nov 2018 20:11:23 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:38194 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727726AbeK2BLW (ORCPT ); Wed, 28 Nov 2018 20:11:22 -0500 Received: by mail-pf1-f193.google.com with SMTP id q1so10230020pfi.5 for ; Wed, 28 Nov 2018 06:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dTSwJN4JRQVZ+k0IVkIDcn8Xu4jKAMDWHghpT1s4ppk=; b=G1X0coXbndfPX1u00zCVALGvWKopsy5wlAEWmsMhf27AoyZOr2lzDd/svHr8Y/1vSj KQTuj2PvzIwS1kgbBMY3j/5kssap7VLfXD+60T9l0VCUasGGdn8CPP0ACjvqyXk4/Ere rKlBEvoaqxUmPCf6pjONtnz1RZWKRUAMlH23jCWlF+5WRCXmyUMSTLK7gmJyN7Ct7T2r cvwOqNueJF0qdjU1/SV7wO+fOOL5UzNQgWG8NDVEKXV+5Qmzb5pcHV9Li3x6IRWIxpvO AJ4oadwuUWLJp0J1OJZeI5mRjOkiqy6zJsdhJVI4oZ4wt+ig/ocaO++OZ6JNg/NJVl2c tqvQ== 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:mime-version :content-transfer-encoding; bh=dTSwJN4JRQVZ+k0IVkIDcn8Xu4jKAMDWHghpT1s4ppk=; b=AHo5jM3vdDiHAXMuW7Y41IFtI3372ojrNFmnXSC+D9LSJQtsayaluA8XGTcQoEYMtp t5mvhmAxWfK/Ad7LtyW7I8566yDlFsO3buy8XnqtSY4YUKdZNBUKbbTnL4bHv5oaMj4C A0lIA+WSwtUSuK3+YUogCUqep15l+UvS78TrIq7krrRq3m9YGqYlVPDHZvcl5kl5ETEM DOpvn8m3tyHVgei9SAnOke6Sf2lMCR+JoVJZuEul78nol/wi6p3FznYr4m+Bw2qp0Xdp tOchofHU+FJalHzTHkeUYL2Ofx9Ebd8ZPW1+V+c8GI/Cr46I5kXsUOzTxLJsQCbaj5gK 6gYQ== X-Gm-Message-State: AA+aEWZoJz6KYyBlvDNw/BNRB52WlOjWmJy5u7CFBApataBS1K0R+Ykc Yh7fMw2ixHzulzJb10ZeOypdRQ== X-Received: by 2002:aa7:8045:: with SMTP id y5mr5670875pfm.62.1543414175042; Wed, 28 Nov 2018 06:09:35 -0800 (PST) Received: from n3-021-216.byted.org ([123.58.9.124]) by smtp.gmail.com with ESMTPSA id c13sm13288604pfe.93.2018.11.28.06.09.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 06:09:34 -0800 (PST) From: Xiaozhou Liu To: "ndesaulniers@google.com" , Miguel Ojeda , Luc Van Oostenryck , Paul Burton , Masahiro Yamada , Arnd Bergmann , linux-kernel@vger.kernel.org Cc: Xiaozhou Liu Subject: [PATCH] Compiler Attributes: move kernel-only attributes into __KERNEL__ Date: Wed, 28 Nov 2018 22:08:50 +0800 Message-Id: <20181128140852.178260-1-liuxiaozhou@bytedance.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Attributes such as `__gnu_inline' are meant to be used within the kernel. When userspace somehow includes (eg. tools/bpf), compilation errors would be shown: "error: unknown type name ‘__gnu_inline’" So just move these things into __KERNEL__ and the behavior is kept as before. Fixes: a3f8a30f3f00 ("Compiler Attributes: use feature checks instead of version checks") Signed-off-by: Xiaozhou Liu --- include/linux/compiler_types.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 4a3f9c09c92d..2fb2c311e5d6 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -161,6 +161,8 @@ struct ftrace_likely_data { #define __diag_error(compiler, version, option, comment) \ __diag_ ## compiler(version, error, option) +#ifdef __KERNEL__ + #ifdef CONFIG_ENABLE_MUST_CHECK #define __must_check __attribute__((__warn_unused_result__)) #else @@ -215,4 +217,6 @@ struct ftrace_likely_data { */ #define noinline_for_stack noinline +#endif /* __KERNEL__ */ + #endif /* __LINUX_COMPILER_TYPES_H */ -- 2.11.0