Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1937845imm; Mon, 3 Sep 2018 13:35:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYW2+NWMkte4raSxb7SC66N/JS64cnkE08qmRBQBckh0mP0AQ/A+Zaf4tzBE75HpmpR1R7d X-Received: by 2002:a17:902:f205:: with SMTP id gn5mr7452011plb.41.1536006913531; Mon, 03 Sep 2018 13:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536006913; cv=none; d=google.com; s=arc-20160816; b=tFZvox5KV7WUCBE9fcQ5ibgokfpCZ0B5trU7DOsjbBnysgr8QoDehS5dzxtRFpcNsR Av3vubnyr1ViPP/zLluBaDPNRtTj4sjmoRRnXXlBIKuDxxSuD3oG1RpQ2LGdvERQ/Q5z ZxfYk+UHP4y0TRCQWqQ3Pw0W2nFDja2W8mVJjB9ecU8wiG/1Ex+HFo1Q7ZH0FT3V2/Ag sIGagWugMCAvrBvd07TQML/3f8SDKmcWgMSYeO6eSY9a2lTqRIW/Zl5R/is5iSY1nJua cf+PvJvuaD+MGhwAdi437pjcCVomPdDq7cSzLVc7nbD9Cb7gvNsq0csiVurujZryMZSg 0Ysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=JxZfHZLAlw2fNcQyZZeLSKrRnZnfVnqnwBDPvad1T3w=; b=UAb3jnwszHTnpCqNsO7O9OydtmHlDnQF/bi8gVSegwSQiAlqQOpb0q7UGyc4H9F+cV qtGhwarU+Yu0gYB07MoWjJHCqhYIZv09AnZMXmGxsj4lilGDlnTuFdCRdKe1da83gj65 Qdf3hv0b1lofVOcKoYCmsDvyQuCkqSjB5VM//yNi5T/7Tfg7dPyMEsBWefMitp6T+8EL w4BEvxZmsid/hlzUVaEYdbsPob2f3kspK5k3h0WNU3w40KKKdzvu194aEzYoS/y/qzMp ZFE1761OUjZspvVFkWPnNHzCmwscfP3Hb10hyxh7uusfKMyytRonccMAyWFOVQdGm2Q+ NPNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QnJAePBw; 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 v20-v6si17415269ply.139.2018.09.03.13.34.58; Mon, 03 Sep 2018 13:35:13 -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=QnJAePBw; 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 S1728420AbeIDAzg (ORCPT + 99 others); Mon, 3 Sep 2018 20:55:36 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44491 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727627AbeIDAzg (ORCPT ); Mon, 3 Sep 2018 20:55:36 -0400 Received: by mail-wr1-f66.google.com with SMTP id v16-v6so1721239wro.11; Mon, 03 Sep 2018 13:33:43 -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; bh=JxZfHZLAlw2fNcQyZZeLSKrRnZnfVnqnwBDPvad1T3w=; b=QnJAePBw4gvwd1i0hVKesOpnX43gTVeT8rqmODVelq0DM/Ef5VQTPOq0gY1AHqdUgk wtiSegaugCj509hqs4NSRLXLxZCfzWP84Zj3dGIsRa/AcXOq3mS75C1V6BqyoMXmdOhd PYdD2p9KI21Q63xNP2IVPkTPmkacgLNcdQWA7SX9HNpKgs9JMX88zje3i8SLh/jqcqi3 KxKm4VApIBEZuyjZNtDIeqT8B84IVdbFvgU0iOoQkPzgO5MTWKDbzn8ykjzVby0g/aXX HVCX77WdTojzxVeEm54JjqpUICUtheoHOyKYziPjGIyFph1TAJlMW+hfmzpW2MzdJksa njpA== 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; bh=JxZfHZLAlw2fNcQyZZeLSKrRnZnfVnqnwBDPvad1T3w=; b=XhnVOwojZGBCrAZsVEB4yEnw1E3MkRQp9yO0TLUQvr8z/d464fir4rjlO2iBnfcGc7 VvnZOStj9l3XvWSHXK1PESvG7uiM6L5qn9s/Q+x/r9SjiCFYalrPU1hCd0ItYNjpRx9T +7KXS/Hyys96X2A8mJ3iKfccH1zoq5bNgiksJpMcYCOSiz3Pc/9YWzlJ7bo6pO2WOhQh pFV8GyaUGMZMjBRQXMKz8KPj4BEZFbMLsWUW024JhG0mlV93ItvFFQ2eP/epzQ7UKnhq tonp/h7xkEToZ2w7ZDdOvpBA25yquEf7o5km8sFt2AoS9NOSVouk2aMDxgOU0z9Ey00H YKgw== X-Gm-Message-State: APzg51D0MDd5r5SksUf5el78oothr8swF0OY/ss8JeXxwXy/iX1lW8pF HesdO68CTz4Iqs6GxEisax0= X-Received: by 2002:adf:ed88:: with SMTP id c8-v6mr20169657wro.264.1536006823158; Mon, 03 Sep 2018 13:33:43 -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 132-v6sm12354870wmd.13.2018.09.03.13.33.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 13:33:42 -0700 (PDT) From: Miguel Ojeda To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Miguel Ojeda , Jonathan Corbet , Rasmus Villemoes , Luc Van Oostenryck , Eli Friedman , Christopher Li , Kees Cook , Ingo Molnar , Geert Uytterhoeven , Arnd Bergmann , Greg Kroah-Hartman , Masahiro Yamada , Joe Perches , Dominique Martinet , Nick Desaulniers , linux-sparse@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v3 00/12] Compiler Attributes Date: Mon, 3 Sep 2018 22:33:04 +0200 Message-Id: <20180903203316.16183-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 The Compiler Attributes series is an effort to disentangle the include/linux/compiler*.h headers and bring them up to date. The main idea behind the series is to use feature checking macros (i.e. __has_attribute) instead of compiler version checks (e.g. GCC_VERSION), which are compiler-agnostic (so they can be shared, reducing the size of compiler-specific headers) and version-agnostic. Other related improvements have been performed in the headers as well, which on top of the use of __has_attribute it has amounted to a significant simplification of these headers (e.g. GCC_VERSION is now only guarding 4 non-attribute macros). This series should also help the efforts to support compiling the kernel with clang and icc. A fair amount of documentation and comments have also been added, clarified or removed; and the headers are now more readable, which should help kernel developers in general. The series was triggered due to the move to gcc >= 4.6. In turn, this series has also triggered Sparse to gain the ability to recognize __has_attribute on its own. You can also fetch it from: https://github.com/ojeda/linux/tree/compiler-attributes-v3 Enjoy! Cheers, Miguel Cc: Jonathan Corbet Cc: Rasmus Villemoes Cc: Luc Van Oostenryck 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 Cc: linux-sparse@vger.kernel.org Cc: linux-doc@vger.kernel.org Signed-off-by: Miguel Ojeda v2 -> v3: New: * Remove duplicated "used" attribute in KENTRY * Silence sparse warnings on __has_attribute & simplify the macro block * Add Documentation/process/programming-language.rst * Improve _attribute.h description * Improve some commit descriptions * Add Reviewed-by's/Acked-by's/Suggested-by's (hopefully I didn't miss anybody!) * Rebase on top of v4.19-rc2 * Cc Rasmus, Luc From reviews: * Fix __attribute_const__ rename typo (Nick) * Add SPDX identifier to _attributes.h (Nick) * Add SPDX identifier to _types.h (Greg) * Remove __attribute__ uses from compiler.h (Nick) * Tweak clang doc comments (Nick) * Move __naked out of -gcc.h to be shared (Arnd) * Use __name__ syntax instead (Rasmus) * Update sparse description (Luc) * Remove __CHECKER__ test from __must_be_array (Luc) * Add note on __has_attribute regarding sparse (Luc) * Cc linux-sparse (Luc) It is quite a lot of stuff changed this time around, I hope I haven't missed anything said in the emails. Please take a look! Compile-tested for a while on (x86_64, gcc-7.3, allmodconfig). Miguel Ojeda (12): Compiler Attributes: remove unused attributes Compiler Attributes: always use the extra-underscores syntax Compiler Attributes: remove unneeded tests Compiler Attributes: homogenize __must_be_array Compiler Attributes: naked was fixed in gcc 4.6 Compiler Attributes: naked can be shared Compiler Attributes: remove unneeded sparse (__CHECKER__) tests Compiler Attributes: add missing SPDX ID in compiler_types.h Compiler Attributes: use feature checks instead of version checks Compiler Attributes: KENTRY used twice the "used" attribute Compiler Attributes: remove uses of __attribute__ from compiler.h Compiler Attributes: add Doc/process/programming-language.rst Documentation/process/index.rst | 1 + .../process/programming-language.rst | 44 ++++ include/linux/compiler-clang.h | 5 - include/linux/compiler-gcc.h | 84 +----- include/linux/compiler-intel.h | 9 - include/linux/compiler.h | 19 +- include/linux/compiler_attributes.h | 239 ++++++++++++++++++ include/linux/compiler_types.h | 101 ++------ 8 files changed, 314 insertions(+), 188 deletions(-) create mode 100644 Documentation/process/programming-language.rst create mode 100644 include/linux/compiler_attributes.h -- 2.17.1