Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2276502imm; Thu, 20 Sep 2018 10:26:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbbxrB6DycCM/5fMSuwJPPFmpgqhzIe2Q7dkrmtnr+DX5i5w4ZLprwrCbHcrrFLjIFhV/a6 X-Received: by 2002:a62:f40a:: with SMTP id r10-v6mr42354076pff.47.1537464360939; Thu, 20 Sep 2018 10:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537464360; cv=none; d=google.com; s=arc-20160816; b=zXvJaquM7cdesPQvO8FS6RvyfytfV5d5y77Jhpbt5l+O6UZLiPoz12+nokhI0c6dgV MD+zf6hmFAs8nyPA2yYr2qIlkIoAqscEtc6v647tnBW0TnkMtN045UHkcso4aC+i59sg dn7cjFBGgxI3xQUVVqSdwN93BGI9olgwuKub+ByZv5LlIAzTVIzqme7ShyL1dSI47fEa /6MtiQ2ckS4V0MKtoRXB2SDQtG2bgfQ3f5aw3t0zWO+KVoX/LO4UTyX3GpIm0pR2KbyV qVVKefnuAX5l2q1LwgaWhjrJhEUzf3tZjyFDdPpmvh1MjW2HqbSwAxDe12g2IPo84jUO edqA== 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; bh=DMcPIrwqXms9WD0kkoWDdZrBP6b9NZOj826HYTgaFlU=; b=UCcNnryp3cFRGlmxizsHWVZ8nOrWO24qN4iwJFhI7ueoUT5T4qkOS9EK2sPVwrKEB1 Qoaxum1kas41bxDW0dhpDDaqDHy95Dy89yJha4r7JkK+3CaB+/V/HoUe89aefnPjcTj6 XWlLck0olNSy5ZoWoUOEQEikpoVshw5VMwV+OmHdXxQdCiEeImFhPXQ1NQ+AtfHUXeWD nK/HKYoOiVbWgmIBt32/2GIan10bYAt4pi4baTBTLoQW65SQaEPHt8Ep/e8PDdDj6kQg /8QCgjqOAb/1rY4fmeqnT1fv3SLgmgWLlC7OQwsCqVi2MaKRBfdpZmZPb9Pf7ufShzn9 eOYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=g8rtPT1E; 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 ba4-v6si24328464plb.240.2018.09.20.10.25.45; Thu, 20 Sep 2018 10:26:00 -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=g8rtPT1E; 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 S2388001AbeITXIF (ORCPT + 99 others); Thu, 20 Sep 2018 19:08:05 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:50388 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387922AbeITXID (ORCPT ); Thu, 20 Sep 2018 19:08:03 -0400 Received: by mail-wm1-f66.google.com with SMTP id s12-v6so345380wmc.0; Thu, 20 Sep 2018 10:23:31 -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=DMcPIrwqXms9WD0kkoWDdZrBP6b9NZOj826HYTgaFlU=; b=g8rtPT1E8Eoyx+j9tu4pGEhD3gHhesom2knFsEfU/KANrXLls5YdqUVG6XB5cRcGdP y4Z+dsZzwSYWvAxIhxfxUjrg5MZyQEsW3fMg/th7ekvi2lHkic/f1vwDQjVQTfZQ8qZO /FkBUE1E5Wfs/I9o5JdRaOy+MCWeUYeJot5eCp+pesXtb7p+3iZXLaG5EuBYczdQshcn 718iF+l3s+iGV4BW6+0pjblcGEzkIl4WyTo6ak6KJRuWVW6ZNlB3jSnap9Gm2XO1t8DM XzsHWao7RIOMW0RM2uFy/UwS+Wz2s3A5r3v8fInigpY0PHSRV0XBLtejAwZQ7d19YKNW BG2w== 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=DMcPIrwqXms9WD0kkoWDdZrBP6b9NZOj826HYTgaFlU=; b=frdtEVUrkmhnpNERzvycKfc2E9h10n2B/j9cyaEWxEOZtRXhRYU6eeHoxjpkZIE7Ck Nzq9LWJdxPaA5veYovB14yIMevovY6IJFmKWwXn3cVEaoydLgxRMtTFRlHda0xMhqYG5 nBNPhMuqTMjIHKzM/xNVvu7g5/TtXtGAltWSotgQhm5lccpfWkJ8BP+JjbydT2nM8las aTpfQd0Oc+eNv3QOCIYPvqJqV01pc9/NjWzdj4NJnih/GYVhaPH/v7Cdzv/PMZck+DFP kTj7Xzqi3rLM7RIUDzYSxdqXF9yXvaxH2qz/tBRy8PVcMe2t7Nk2RRwzT50f5m2VpO1u CoHA== X-Gm-Message-State: APzg51Bh6C1Q5KwmPMWdAwX3PnR4vb12PS8IpTAGA6pd2gHUqnmdSJfx zLSYnGyo7AEKQ1hU0xzWDU4= X-Received: by 2002:a1c:3503:: with SMTP id c3-v6mr3876931wma.46.1537464210885; Thu, 20 Sep 2018 10:23:30 -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 q200-v6sm3466562wmd.2.2018.09.20.10.23.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 10:23:30 -0700 (PDT) From: Miguel Ojeda To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Miguel Ojeda , Andreas Dilger , Masahiro Yamada , Michal Marek , Steven Rostedt , Mauro Carvalho Chehab , Olof Johansson , Konstantin Ryabitsev , "David S . Miller" , Andrey Ryabinin , Kees Cook , Thomas Gleixner , Ingo Molnar , Paul Lawrence , Sandipan Das , Andrey Konovalov , David Woodhouse , Will Deacon , Philippe Ombredanne , Paul Burton , David Rientjes , Willy Tarreau , Martin Sebor , Christopher Li , Jonathan Corbet , Theodore Ts'o , Geert Uytterhoeven , Rasmus Villemoes , Joe Perches , Arnd Bergmann , Dominique Martinet , Stefan Agner , Luc Van Oostenryck , Nick Desaulniers , Andrew Morton , Linus Torvalds , linux-doc@vger.kernel.org, linux-ext4@vger.kernel.org, linux-sparse@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH v5 03/15] Compiler Attributes: remove unneeded tests Date: Thu, 20 Sep 2018 19:22:49 +0200 Message-Id: <20180920172301.21868-4-miguel.ojeda.sandonis@gmail.com> In-Reply-To: <20180920172301.21868-1-miguel.ojeda.sandonis@gmail.com> References: <20180920172301.21868-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. https://godbolt.org/z/DFPq37 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. Reviewed-by: Nick Desaulniers Reviewed-by: Luc Van Oostenryck Signed-off-by: Miguel Ojeda --- include/linux/compiler_types.h | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 8fbdd47dd3d0..5ff9cda893f4 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 __attribute_const__ __attribute__((__const__)) #define __aligned(x) __attribute__((__aligned__(x))) #define __aligned_largest __attribute__((__aligned__)) #define __printf(a, b) __attribute__((__format__(printf, a, b))) @@ -211,6 +208,8 @@ struct ftrace_likely_data { #define __alias(symbol) __attribute__((__alias__(#symbol))) #define __cold __attribute__((__cold__)) #define __section(S) __attribute__((__section__(#S))) +#define __always_inline inline __attribute__((__always_inline__)) +#define __gnu_inline __attribute__((__gnu_inline__)) #ifdef CONFIG_ENABLE_MUST_CHECK @@ -235,18 +234,6 @@ 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 - /* * Force always-inline if the user requests it so via the .config. * GCC does not warn about unused static inline functions for @@ -271,10 +258,6 @@ 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 * noinline_for_stack instead. For documentation reasons. -- 2.17.1