Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1434496imm; Sun, 2 Sep 2018 23:44:29 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdasia+jR1pR5Fr4oPyD25nupjaYFsZMD8FjPMyZdkSxFOOWx/+cmYb7sLnjwZ3e1NywuQgh X-Received: by 2002:a62:858c:: with SMTP id m12-v6mr27953947pfk.173.1535957069186; Sun, 02 Sep 2018 23:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535957069; cv=none; d=google.com; s=arc-20160816; b=we2k2w5qNy1HfIfisg2UWb+/L4B4ml+AKrTYYDZ/FaTDAzVo4+/ZWzCuvKcWhdNT/j EHBz2SJ7mW15Q2Vq9T8NdVggR3egGgy7ovfgGB98Kozt6VpiCS02zpJuLQI6Am+hE0Lz l4szdVRFWEGSVOvgnDPZju8ohltlOFdGz2exGlLRIS5fVUAKtf7xn06uM/RZOV65+mCj Nb/Y6wwEhy2GSkvd6QoWgBV/sw5HWtKTQATKw2qqFxNZdQ7C/AhD5HPpFCshSP+6bREZ 1YxpDYusNBDgg2S56rsrgJIIuNMjI7GDsBQMvbmK9v8xxC9Voj7Q+gh5SLViJa9J+fAS 73pA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :arc-authentication-results; bh=zyZzw3hs9hvoI6Zc3Y741lTaXE5IkisCIuo7BIiJ2a4=; b=hqesp9DIb4Bez+R8B1CqmJU1baNe+p+Xd+TiQEPf3kgnXwiX1XQ6SdRxIb/gSnxvBF hhBM6GbWmbo9z5BvL4VeG8S50gqJTnrk4oVyD5+EAXJUZ9mLUf7iKuZPRnwTAfMS6Thb 8eNBomBl1e4dKzoPUIoUydRXSR53ERCiviA/VCA8QacEEdCfkc57uiKuJzAWSQnmMVPM OI1YgijB+cwWZu3eLmq9z+Qmnnxxsr6UwXQNusjQQ+DWMKRDhdxlixvapERY5DpcpSjr +VF7mIVt7pbvDW5fwmdwdisLD6odmTIcgFDrFE88yLguv3jC/2a+++Is/9FljXntvvLW S2Og== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3-v6si15336370plz.21.2018.09.02.23.44.14; Sun, 02 Sep 2018 23:44:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726314AbeICLBY convert rfc822-to-8bit (ORCPT + 99 others); Mon, 3 Sep 2018 07:01:24 -0400 Received: from mail-ua1-f67.google.com ([209.85.222.67]:44948 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725927AbeICLBX (ORCPT ); Mon, 3 Sep 2018 07:01:23 -0400 Received: by mail-ua1-f67.google.com with SMTP id m11-v6so12360819uao.11 for ; Sun, 02 Sep 2018 23:42:39 -0700 (PDT) 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:content-transfer-encoding; bh=U2PHNA4yBROlC284LF56lKhFIU0/CuTbGPBSC8JbQSo=; b=OOzQljUbkMjMdzkAufJDnumUUEym+Z58945dL9C8N7uHCXMH5mbwnTa6wLCb9TbMyl Luj3dRGZUYU3l7yV7xTzaNyNpHsdnMQMfyjAKq9JMWrC1Ga4D8Vv6OisELnb7nr8mrQ4 IdkRXdDWFTPhykTeuf//HJ5j4Nh1Sv2cg1hXu38gK77msJfteHj4y2N93vzo9e8ECmBa bQVHVuDu8u5yHAPSqINYpwJDYk9rKDf4BcnIfDWps0Xlv6ouG2A6ASEwz34BIWGByXr/ XBKq6mMCNiIUc27gDS+GIzJlFtBBT7UdZt5RPRn1hi+7duuoWRMok8YTbYHcevbj+89E +xcA== X-Gm-Message-State: APzg51DeF4U3STbup1FVQb9+y42PUEbVxvZfC4NJ4+5TxSs2nhGERbqs d80HDX0TIg9qbbmX+/fE2WLEggvQRBGRTHxia58= X-Received: by 2002:ab0:13c7:: with SMTP id n7-v6mr15141808uae.47.1535956958633; Sun, 02 Sep 2018 23:42:38 -0700 (PDT) MIME-Version: 1.0 References: <20180831170514.24665-1-miguel.ojeda.sandonis@gmail.com> <20180831170514.24665-2-miguel.ojeda.sandonis@gmail.com> <0a8588f3-929a-608f-1fdc-e24b90e6b59b@rasmusvillemoes.dk> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 3 Sep 2018 08:42:26 +0200 Message-ID: Subject: Re: [PATCH 2/7] Compiler Attributes: use the no-underscores syntax To: Miguel Ojeda Sandonis Cc: Rasmus Villemoes , "torvalds@linux-foundation.org" , Linux Kernel Mailing List , efriedma@codeaurora.org, Christopher Li , Kees Cook , Ingo Molnar , Arnd Bergmann , Greg KH , Masahiro Yamada , Joe Perches , asmadeus@codewreck.org, Nick Desaulniers 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 Hi Miguel, On Sat, Sep 1, 2018 at 12:41 AM Miguel Ojeda wrote: > On Sat, Sep 1, 2018 at 12:10 AM, Miguel Ojeda > wrote: > > arch/parisc/boot/compressed/misc.c:#define malloc malloc_gzip > > include/linux/decompress/mm.h:#define malloc(a) kmalloc(a, GFP_KERNEL) > > lib/inflate.c:#define malloc(a) kmalloc(a, GFP_KERNEL) > > include/linux/compiler_types.h:#define noinline_for_stack noinline > > include/linux/raid/pq.h:#define noinline __attribute__((noinline)) > > tools/include/linux/compiler.h:#define noinline > > arch/mips/sgi-ip27/ip27-reset.c:#define noreturn while(1); > > A better list, searching for all attributes used anywhere in the kernel: > > git grep -E '^\s*#define\s+(address_space|alias|aligned|always_inline|assume_aligned|bitwise|bnd_legacy|cold|common|const|constructor|context|deprecated|designated_init|destructor|error|externally_visible|flatten|force|format|format|gnu_inline|hot|hotpatch|indirect_branch|latent_entropy|long_call|malloc|may_alias|mode|model|naked|nocast|noclone|noderef|noinline|no_instrument_function|nonnull|no_randomize_layout|noreturn|no_sanitize_address|optimize|packed|pure|randomize_layout|regparm|require_context|safe|section|syscall_linkage|target|tls_model|unused|used|user|vector_size|visibility|warning|warn_unused_result|weak)(\(|\s|$)' > > arch/mips/sgi-ip27/ip27-reset.c:#define noreturn while(1); > /* Silence gcc. */ > arch/parisc/boot/compressed/misc.c:#define malloc malloc_gzip > arch/powerpc/xmon/ansidecl.h:#define const > drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:#define error(fmt, > args...) bioslog(ERROR, fmt, ##args) > include/linux/compiler_attributes.h:#define noinline > __attribute__((noinline)) > include/linux/decompress/mm.h:#define malloc(a) kmalloc(a, GFP_KERNEL) > include/linux/raid/pq.h:#define noinline __attribute__((noinline)) > lib/inflate.c:#define malloc(a) kmalloc(a, GFP_KERNEL) > tools/include/linux/compiler-gcc.h:#define noinline > __attribute__((noinline)) > tools/include/linux/compiler.h:#define noinline > tools/testing/selftests/futex/include/logging.h:#define error(message, > err, args...) \ > > None of these should make a problem. And it would may avoid people > using such common-name-macros in the future ;-) That's very fragile. Who knows all (current and future) attribute names by heart, and that defining them could have such side effects? At least "alias", "force", "format", "mode", "model", "optimize", "target" are names I wouldn't hesitate to use as a macro name in a driver... Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds