Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5068imm; Fri, 31 Aug 2018 15:12:12 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYU6K7nq09A8Xmw15WC+7QT3w6ccyieVBvKQl6ISZrVciPHjua5tX6EgBJmkCk5Ey19kRrd X-Received: by 2002:a17:902:8a90:: with SMTP id p16-v6mr17622828plo.106.1535753532738; Fri, 31 Aug 2018 15:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535753532; cv=none; d=google.com; s=arc-20160816; b=w7Zb0Iz10olpx5h4hoyd6ayJvjktut9efA7QYf63fB0HOgVbDOwaggNqEFitMYS8lT 011WeYWdlZWofKdZl1gqt7mvKMTAygNQUsa5vAoaimxok39xd0fg95ga5aOLLzFYDA5j ktx5g+i8A53FHxwyM8BWy9MkyQhqSPfRkQMfY556y1/D+s4iL36inB0XT3Kk38bfHeWD mz7dyPKM4rV3ZwIRSGl1kmT+zCGDFSNuGZD/5DQYAk3UVKiPpgoF/SoAb6nqep0YEecp tn70u5TRt3xFCQWRI8M/cC8xo9yCwZdNgoZVRY534D0cCM9oB1G/tCPE/vbSSK20iNKV tPsA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=/NoraxHa8GBeIssLf21fYSdvlpg/R0M7TFjxYJOe7dk=; b=Uks4sWj3Rv+pxHqkg3Wb/CV1ZO96xDkA/U2EGrkYfudgLKo4R8QWTDPUBo0oChSTLw 0ShxOL1kMNJWI03PL4G75z8eU9HCihqewhPWx3i8jsDZIZQA5RdCUVJYTBVnZBtlvRi5 3hn4nK6Xg4+0Z+G7PTK4d4nqpt/3c1PdPV5hE1LFH3R/S8zPX6/6tg19R4CcrW8ZJ9sK SWLQNzC8RZoeNSyCeVf9eO/McklpedJHSB1QClBTW7gojuAqDEZZia04o8liEna4qspI ZdVBgY1QkZHUU579pkxtmhSE3zpwpnqMj9XLgcMEv/xOV+rlWxpoZyiO41kKIMwi5XQb Li1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JTQV6tQg; 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 i5-v6si9619348pgo.197.2018.08.31.15.11.49; Fri, 31 Aug 2018 15:12:12 -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=JTQV6tQg; 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 S1727316AbeIACTy (ORCPT + 99 others); Fri, 31 Aug 2018 22:19:54 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:40591 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727212AbeIACTy (ORCPT ); Fri, 31 Aug 2018 22:19:54 -0400 Received: by mail-qt0-f195.google.com with SMTP id h4-v6so16239188qtj.7 for ; Fri, 31 Aug 2018 15:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/NoraxHa8GBeIssLf21fYSdvlpg/R0M7TFjxYJOe7dk=; b=JTQV6tQgxyN763Ac0GBEAKfn7hCpOQKXMSt2DvbBDJJIWHaf/4r7jn2fPus5IaWZdU WDmj1lX8DD/C5T5pNP/BDAkC85bUHToZpjhlVPwriP4iLyiXa6vaPlW1sAxWlXPuu0Gy X0qiShvaCVKpoq1oYbx/9m/mUPwv1jxJ1ZJOUcMZrEMzcnUT9c9U67x42PUTLVSEFLdH h8vQfFqGe4xVj5VF4Z1YL3IuVeSm9ycpDjeF7k6IgbEh0Chtt2lY24fVJBfQRgWOu0cq sC1gQixgrQQXp6zkNlaw3c/5Q3Zriv/sbOiBZ4QhVN8BjkIgLc1wgzXyoci+r9OoAXvJ 9TYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/NoraxHa8GBeIssLf21fYSdvlpg/R0M7TFjxYJOe7dk=; b=RVrUVp9oFvUbg7MAxLUgbucwd1ZQrMC8jP/brGSJsoxm/LVpQepgdvxCZl24NyYlVt yKfXlEbGA+hqqrNn/Ba+uyBWFZWL88QZPQmtFqXaF6T503q5Qu/5XHwWt9UK61CpQxxp Qxiq0aJnhMX0GBLwLCPWewe3cbA1iQlYO3P9SWS/tko41HwRn81wFmEJ4ZyiHcK40wGf m2q2Wu9YkTAspYHP3IoQHnzjIPECaS4PKFi3eCMASppyBiKp+LN8oX5PS9cEWstsAxls kk9ncfyYQN0qWhK+WTIEaccOY9RgXAKXnUVUa0zGtpuhMe4LhCdDRAaXMbflsQmXWzqn c1Cg== X-Gm-Message-State: APzg51AAFmr0bPLI26NNan0XQe6U5rURq9odfx8aMIc3anuYxBv6IDlx MmPFweDQUCUOJ0KxDI0i7aQ1qzRMi57EsRL2oYs= X-Received: by 2002:a0c:aed9:: with SMTP id n25-v6mr17240687qvd.10.1535753424748; Fri, 31 Aug 2018 15:10:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2291:0:0:0:0:0 with HTTP; Fri, 31 Aug 2018 15:10:04 -0700 (PDT) In-Reply-To: <0a8588f3-929a-608f-1fdc-e24b90e6b59b@rasmusvillemoes.dk> References: <20180831170514.24665-1-miguel.ojeda.sandonis@gmail.com> <20180831170514.24665-2-miguel.ojeda.sandonis@gmail.com> <0a8588f3-929a-608f-1fdc-e24b90e6b59b@rasmusvillemoes.dk> From: Miguel Ojeda Date: Sat, 1 Sep 2018 00:10:04 +0200 Message-ID: Subject: Re: [PATCH 2/7] Compiler Attributes: use the no-underscores syntax To: Rasmus Villemoes Cc: Linus Torvalds , linux-kernel , Eli Friedman , Christopher Li , Kees Cook , Ingo Molnar , Geert Uytterhoeven , Arnd Bergmann , Greg Kroah-Hartman , Masahiro Yamada , Joe Perches , Dominique Martinet , Nick Desaulniers 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 Hi Ramus, On Fri, Aug 31, 2018 at 11:49 PM, Rasmus Villemoes wrote: > On 2018-08-31 19:05, Miguel Ojeda wrote: >> The attribute syntax optionally allows to surround attribute names >> with "__" in order to avoid collisions with macros of the same name >> (see https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html). >> >> This homogenizes all attributes to use the syntax without underscores. > > At the risk of bikeshedding, why not the other way around, exactly > because of what you write above? We have convenience macros anyway, so > those verbose leading/trailing underscores would only be in compiler*.h, > and some of the attribute names are common words that can appear as > #defines. E.g. error is defined > drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c ; if that used a > BUILD_BUG_ON somewhere, the > > #define __compiletime_error(message) __attribute__((error(message))) > > would break. Indeed, if we are afraid of such cases, we should go with the __name__ syntax. I was trying to go first for the "cleanest"/simplest way first, considering no one should be defining many such macros as "error" (and in lower case, at that). But indeed, good catch! Grepping for those in compiler_attributes.h (which, as you point out, are not all of them) yields: 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); /* Silence gcc. */ Cheers, Miguel