Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp815868imm; Fri, 31 Aug 2018 14:12:53 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZOCdALBpvOpa1Y6afvMu/VwUrbG2zANMenSclRyAy4huciAacqvgLlzv51uMcHDY8UP+cF X-Received: by 2002:a17:902:9696:: with SMTP id n22-v6mr17484638plp.212.1535749973595; Fri, 31 Aug 2018 14:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535749973; cv=none; d=google.com; s=arc-20160816; b=TCyHzfAl1Bw2yXW2S5g5putDjRpTCPWLaJ2Yb6qW1UozFImScw4npiKRYCxR/hnnhU RCTPHRLMJynIXMjev9DJlrVwVWmVmlYQpwrG5k7aQd8HYyBV3RDX6xTnThJTIDa7eKXR Pwowp5sEHpjLAaJrJ2zDDK8N3RlmbPKsZ/WxvL8NqqWHSZ9O/sAnnOp4IPftYRTbaLam eT6GXdMt+lC4duiLHvbl9bqdn3BBBSlo5NKy/JhjFZCnFp++CsURD+9/tg27iq0Ugr9Z PygSay42NeC7AWvr7X2yUVyzzkrd5qPU5opcnWWWm63BOOoxPftmPT6uFNNztcGona5O kOzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=qjhTV6A49Lf+cie7lDlElWuF/0UFRgU6xXOkHUOo59o=; b=uXeYgCvhJ66Wn/GRTbarkd6dB7ZADe55Zjtc85QBXxFPu6Q9uRvZDYo3ybvnfYkxSQ WAmfd5ibHsidf7tKBSgMSEHjhBf1oHnfWsUbnuKj6fS6L8TLj/HatCA8FnNsSczPnz++ +xwjkXNfx0npt4SSxjCRcx2c+RaiI0R+Rzv6A02JDM9Xm9AwGQ+bBNMTi3S75iAJeslp twXAtvfQf4b58QdCuWO7gIM6nEkhsM7ga5ZdOrjDXmMzIJL6klO8Hpu1dYchMftGIxyY khUkJJTUFv3Pj8RQmCCXj4FJn2AlXTlwAR2F4w+o6PDr2w02CoubMUNmayJzauju2JR6 fZGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=t7Bdaz0W; 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 d41-v6si10527912pla.172.2018.08.31.14.12.36; Fri, 31 Aug 2018 14:12:53 -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=t7Bdaz0W; 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 S1727282AbeIABUI (ORCPT + 99 others); Fri, 31 Aug 2018 21:20:08 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44663 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726869AbeIABUI (ORCPT ); Fri, 31 Aug 2018 21:20:08 -0400 Received: by mail-pf1-f196.google.com with SMTP id k21-v6so6032358pff.11 for ; Fri, 31 Aug 2018 14:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qjhTV6A49Lf+cie7lDlElWuF/0UFRgU6xXOkHUOo59o=; b=t7Bdaz0WqXKHg/xUR1IMpHklxksEL436qzzgrfj7393WGLe5cx60v5twtCG/M7ix5G YoDBgoSVvGuEd3YJ0D8wjOM/VaISbnQockkcrazOe07jRv4EoxfHfxa3dB76vLsXJ+gx +sDRPoqsidzu+JI31N0cuvHX/PvQ5W29dzogeUMqnHvekYWf+cZ9Nrcr+HxuNxV0XY7m zMdqPND1fyk540T1TMt6zA8l1Siaz8GdZFj0kAkcr35HEnk+7LFb+MQ5hsGON1rWRs5R 54R54IfcPzqJ69ay9SxE3eS2f0+jNGFkDrkeppviMKTIml1WoZa5iEGMFbhtnIsJR3Wa v8GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qjhTV6A49Lf+cie7lDlElWuF/0UFRgU6xXOkHUOo59o=; b=WvZp7ouT5k7T+XBxITovHYP0RkjFye1KK7e0SaWcO/IDuWlAxMY06SynZbzsjcRtTm Ab6zRuBL8SMZM8E35RJZkOZsZJ88Y5nHsgNb9mUsm464j/XfeVxK0PGGinOOYvtqFIMe Wl3tbEliy89RxLh7nE4wJUvy/gmvZCcVQn7L4AL6D0VTK+KNA8EI7gqHqaAb3zqE6tSo hYEe/Xv1wzO1xvSm318R6IIg2Hi3d4SgZLFfl90oGApS/3w2wYwIYBzzIp/xfOX+ZUbC fXVks/ya1FKkezv5zUu7cHoHP+GlVQJfBGaWzXU2cC3aVhrVPaqzOsVzwUsCLkDMe/0a vDBw== X-Gm-Message-State: APzg51AIcWRNGBOIWUu0fXZmeFkHFEHa5eTzl6LTlrXy0KgoOQyXY1My wZJPBJmyuNlMPJknaf0oJAKGVeFtHdNEiTA3Z8NUUw== X-Received: by 2002:a63:1921:: with SMTP id z33-v6mr8208900pgl.302.1535749850912; Fri, 31 Aug 2018 14:10:50 -0700 (PDT) MIME-Version: 1.0 References: <20180831170514.24665-1-miguel.ojeda.sandonis@gmail.com> <20180831170514.24665-3-miguel.ojeda.sandonis@gmail.com> In-Reply-To: <20180831170514.24665-3-miguel.ojeda.sandonis@gmail.com> From: Nick Desaulniers Date: Fri, 31 Aug 2018 14:10:39 -0700 Message-ID: Subject: Re: [PATCH 3/7] Compiler Attributes: remove unneeded tests To: Miguel Ojeda Cc: Linus Torvalds , LKML , efriedma@codeaurora.org, sparse@chrisli.org, Kees Cook , Ingo Molnar , Geert Uytterhoeven , Arnd Bergmann , Greg KH , Masahiro Yamada , joe@perches.com, asmadeus@codewreck.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 31, 2018 at 10:05 AM Miguel Ojeda wrote: > > 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 > - If there's a v2, you could order this before the patch that removed the underscores so that patch is smaller. Doesn't really matter though. > #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)) Can this be moved into the block above with all the rest of required attributes? > > /* > * 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 Ditto. > > /* > * Rather then using noinline to prevent stack consumption, use > -- > 2.17.1 > With the requested changes, Reviewed-by: Nick Desaulniers -- Thanks, ~Nick Desaulniers