Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp679575imm; Fri, 31 Aug 2018 10:16:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ/N+B6z2zKD5y3c4zYe5bXydaP7InmpYsLVM7EcKSmRwHXFmzxq6Vqkmy70tb/yUbxyazG X-Received: by 2002:a62:cac5:: with SMTP id y66-v6mr16869509pfk.187.1535735765423; Fri, 31 Aug 2018 10:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535735765; cv=none; d=google.com; s=arc-20160816; b=P8T/AopcBr8fS1GzX82C93iGw514yWigSMxnjm9+gn05qtfPobQxwu5G8Y3HSwG9u0 wWAuXWi1zOoUJdqjKWBEhiNnQQWWzfkdLxp+x9mbpy0ABCy300sSmr8tenX+uF0hWWmC R2tMQvp/S8LhBbGRwi/Z90XX7HDQeU1ScIKLEP1TUOSNFXsa10aS9id6J8XmcnWnunDE Kqen/tgNKyD1F3nH16KuxS8hKkqqbJy5/sdmG6S3XHBtaibI71yStfu4DfC7N0Lwuzq5 RH6m9CZhP8xxF7ofam+axkGyb7fF9MoDjTQI+4YnAVoefbSrGM+t9xD5cb3nB9XIsW+3 xr0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=0v/+Zwx16Fnpgc4bSyVBE5da4LsVXCU9DjhKCldisdI=; b=aZBfETWlIe2AvZ0x1jAR3mpXCzMpBov53loRLD771x2vRLhfsxAqCO6HMxTg4Qr22Y WLUlQJIN/iOvDpF/70D3izouNE+04iL/H9wCy9LyeGSIt8goWunZBTdVxfXvF5CXVhJX K6Yh2LzucoUZJeJrIJcdDd2XCqRtLYzO9wvs2eJPDjQ0XWqaCZv/i34VUBTSPEOJYars k0Vutzc8FA7DFQ26R0ckFoW/PvKqhZGx49b2VBs4KiMTX3q7gfyrPPQ6ydxpIAm4xm41 ssmEXQehvfwGz+omfSd2TeCABf2eg2WAkgn9xDUbpBYpW7lKgaZgZIABBgNeImiM7Oty PqWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RlUjtXkw; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r124-v6si13474749pfc.202.2018.08.31.10.15.51; Fri, 31 Aug 2018 10:16:05 -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=@gmail.com header.s=20161025 header.b=RlUjtXkw; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728223AbeHaVNv (ORCPT + 99 others); Fri, 31 Aug 2018 17:13:51 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40981 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbeHaVNu (ORCPT ); Fri, 31 Aug 2018 17:13:50 -0400 Received: by mail-wr1-f65.google.com with SMTP id z96-v6so11850399wrb.8 for ; Fri, 31 Aug 2018 10:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0v/+Zwx16Fnpgc4bSyVBE5da4LsVXCU9DjhKCldisdI=; b=RlUjtXkwdrUqd8rTAnNhtDpeq8I9tWN+zOQ6Yp+1Ycp4EZ5NlGLP/2NkkUs0Uc5CEG NyvQRSwvJUKKnSjF7XoLF0MmJUVJ7jFcxal/21x2IjUo9lblVIeZttWigs6CUmxT2W5h zOTIsLE7IwkX5Nx9LAzFaG7mcFUrF+A9QJZ29BNPsSlDjDV7dp0cnAcmi5vZAd5VnLst vtKhMZYncCk+1irgbrpkW/BFOKkoFxFaUqkxMJ0Uu087EQD3O/LpJBm7WznpYnMWUDnm Eo48WtNs3LmBkMqS+aExAAwfpGSOecsIN3ya+IT5b5D1XT2T+z9vHVgfqJ3+xp0KqnyF 5SKQ== 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:in-reply-to :references; bh=0v/+Zwx16Fnpgc4bSyVBE5da4LsVXCU9DjhKCldisdI=; b=G1usI+ipYVx92zHMaP6ApjBCjxwWDtvcK0AdJORphy8ETytmTd44HSjbYGFz3jmrJN O9xJJXHbzAPG9tgZAidiQCni1vTcu8Jphhy82vOYacIeGs0cTeblWz7y7DdIKuw8j2eF oMGblz0wtr696ct/L3XpWrhrWL4Q9hsygErrZbi9xbjHmxSKUlbBhQ5ts4bEf6jLYAue r1xEV4xjmqJdhuGroqlfLGw277+7wPEQKBwGZ+K785JwbbDdEJpZm0i/Vd89jWR1ut2w Jju23x3mYDHnCMyM9pKHonhg7w2xHfqaxW+hv/S/PcFM1rHyVBo9zuSL6J68Ty1HZYtK jD+A== X-Gm-Message-State: APzg51A/WEBJDWT32RAJxYCGgU9ySpdNnJ/WaVJX/dB2ai4k/ehkvZue VQLI7jpmfmEUn+Nj81dpUvY= X-Received: by 2002:a5d:5606:: with SMTP id l6-v6mr11772258wrv.209.1535735124673; Fri, 31 Aug 2018 10:05:24 -0700 (PDT) Received: from localhost.localdomain (62.83.35.8.dyn.user.ono.com. [62.83.35.8]) by smtp.gmail.com with ESMTPSA id c19-v6sm11280332wre.86.2018.08.31.10.05.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 10:05:24 -0700 (PDT) From: Miguel Ojeda To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Miguel Ojeda , Eli Friedman , Christopher Li , Kees Cook , Ingo Molnar , Geert Uytterhoeven , Arnd Bergmann , Greg Kroah-Hartman , Masahiro Yamada , Joe Perches , Dominique Martinet , Nick Desaulniers Subject: [PATCH 3/7] Compiler Attributes: remove unneeded tests Date: Fri, 31 Aug 2018 19:05:10 +0200 Message-Id: <20180831170514.24665-3-miguel.ojeda.sandonis@gmail.com> In-Reply-To: <20180831170514.24665-1-miguel.ojeda.sandonis@gmail.com> References: <20180831170514.24665-1-miguel.ojeda.sandonis@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Attributes const and always_inline have tests around them which are unneeded, since they are supported by gcc >= 4.6, clang >= 3 and icc >= 13. See https://godbolt.org/z/no0OZH In the case of gnu_inline, we do not need to test for __GNUC_STDC_INLINE__ because, regardless of the current inlining behavior, we can simply always force the old GCC inlining behavior by using the attribute in all cases. Cc: Eli Friedman Cc: Christopher Li Cc: Kees Cook Cc: Ingo Molnar Cc: Geert Uytterhoeven Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Masahiro Yamada Cc: Joe Perches Cc: Dominique Martinet Cc: Nick Desaulniers Cc: Linus Torvalds Signed-off-by: Miguel Ojeda --- include/linux/compiler_types.h | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 7cd958360ead..3662b19599fc 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -158,10 +158,6 @@ struct ftrace_likely_data { (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \ sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) -#ifndef __attribute_const__ -#define __attribute_const__ __attribute__((const)) -#endif - #ifndef __noclone #define __noclone #endif @@ -196,6 +192,7 @@ struct ftrace_likely_data { * [...] */ #define __pure __attribute__((pure)) +#define __const __attribute__((const)) #define __aligned(x) __attribute__((aligned(x))) #define __aligned_largest __attribute__((aligned)) #define __printf(a, b) __attribute__((format(printf, a, b))) @@ -227,17 +224,7 @@ struct ftrace_likely_data { #define __compiler_offsetof(a, b) __builtin_offsetof(a, b) -/* - * Feature detection for gnu_inline (gnu89 extern inline semantics). Either - * __GNUC_STDC_INLINE__ is defined (not using gnu89 extern inline semantics, - * and we opt in to the gnu89 semantics), or __GNUC_STDC_INLINE__ is not - * defined so the gnu89 semantics are the default. - */ -#ifdef __GNUC_STDC_INLINE__ -# define __gnu_inline __attribute__((gnu_inline)) -#else -# define __gnu_inline -#endif +#define __gnu_inline __attribute__((gnu_inline)) /* * Force always-inline if the user requests it so via the .config. @@ -263,9 +250,7 @@ struct ftrace_likely_data { #define __inline inline #define noinline __attribute__((noinline)) -#ifndef __always_inline #define __always_inline inline __attribute__((always_inline)) -#endif /* * Rather then using noinline to prevent stack consumption, use -- 2.17.1