Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4857196pxb; Tue, 5 Oct 2021 11:49:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzYtlgQkXJAQEIsIj8I0O7d6WlUZOU+HeiHryNmSFTlmjWwM6FtMNXAK6Wpa1mlTxPdMbY X-Received: by 2002:a63:b707:: with SMTP id t7mr16691160pgf.55.1633459788540; Tue, 05 Oct 2021 11:49:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633459788; cv=none; d=google.com; s=arc-20160816; b=aQ/pp/CuWp7+narnUYk2YD/cA60HAE4c/i+Ql+fyHsQMwFGMqhg3J5eqpXyh4Of5Q8 8hJ5SEuQKN6ToXjf3U05EVQ4tbj5anhuWMXBwrNQgQFpB5eefdTBtymT7HNagY2QTEyE sqMKiTTPpedGhs1V6oaO2WSKfKHLR1MQtmTqq9NDFiQUi+kkfoqdeQZBhNgi8MNYjoPx jprOYkMvl03XDCUOj0w635AXxWxQWAy08yE/yTvvEPm63rGvT9iol07LJvANkzhd8+k7 TjtdCVNarBfMxOKlXU0fGVRq/n19tqGuPgaK2Txb7Zf4wLXU17o7oS47RRuaLJHAIBoR 7A+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=A2NgxD1/eVKF5aA/6vOIKBsVzYpDnTEprcND7FDOo0M=; b=szrMdOI1rn5oCr9BMY3Qs50HeGcqD9xHhxsMMlZh7KdDmMP1jUA2TkeA5eY/MGGoZI WhRz2a2s/kSnO4Ay47gktGmuU1Iw3+VL2QNa1KU4Xe9xd/+DNywyKa94jYk/RWPd0Iqd yNUP6O322zb/LVDW8eTIRRclsrvZNYKVZKLJ1zdRb7aNSs+ymOlo3szw2ZXNFQ5C82HU /9EUDSHAitVVquH09ir+K5HFPw14Ge/ExxNDnp8YbWPuGo6sGt5NCrlKBqQweFn5Au+d DGn6eGXUl8g/QdX7qIcY4EWaOBBjlUo0JflXVh3YZIcJbgoc13BkeQ88+jBXW+TBxL3I qR8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=fFls5kf5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t19si23987513pgu.235.2021.10.05.11.49.35; Tue, 05 Oct 2021 11:49:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=fFls5kf5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229684AbhJESul (ORCPT + 99 others); Tue, 5 Oct 2021 14:50:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbhJESuh (ORCPT ); Tue, 5 Oct 2021 14:50:37 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B2F3C061749 for ; Tue, 5 Oct 2021 11:48:46 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id d8so342785edx.9 for ; Tue, 05 Oct 2021 11:48:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=A2NgxD1/eVKF5aA/6vOIKBsVzYpDnTEprcND7FDOo0M=; b=fFls5kf51lCIVFfkvGfs/xBe5XimbcYmLquWrEgTuzI0E86OeuXyL7p0wYGBeMKXp6 n2zUmaPptcJGf4ySWE3LboQxkcw2GdxkxT8U487eGeQ/OELckpICsePkKJ7Jb5gQzOMp DHouSPks6GOygmlOmWexqYsjUFUsR5vaYJxuA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=A2NgxD1/eVKF5aA/6vOIKBsVzYpDnTEprcND7FDOo0M=; b=WqcosJ1yYOJt2VDeThX6U0lU+SEZfFnXFOR89sIjuga1ItYq0234cDgiR5ejXmA6WV aCsCaheIIOyHesVKJfGTxCJEt6Nvcb1D4A4zOWUxoAO1XaAhkVOZWkhZOwQmVV2+iuL/ NwogGuY3b/toXJ0BNVcuIp9OEWZuH0BU3HCbOrE7oN5FY+HoOL9RYQjcBB9nHwjz7kq8 yxq+IINKX9OUGIE5suwGZbJDLvR/8Bpvb3/2ZeUuH/us+pJD0QKZXMBTABaWBcVFt3dA XAp7o/8MJSBQyLNrudC/+3djtzGLzH6j7HBTSwUTrG/1DSTZz+JzLiYJGtZAdu3lza6S yVLw== X-Gm-Message-State: AOAM530OiCbNrl5jx5ei9SGXV7WrxfKviiGDAML1cliy4D6T2AVDqOMW rga53A/WnwdHUaEnszDEwL2+Eg== X-Received: by 2002:a17:906:cec6:: with SMTP id si6mr2070177ejb.270.1633459724617; Tue, 05 Oct 2021 11:48:44 -0700 (PDT) Received: from [192.168.1.149] ([80.208.69.72]) by smtp.gmail.com with ESMTPSA id lb20sm8091267ejc.40.2021.10.05.11.48.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 11:48:44 -0700 (PDT) Subject: Re: [RFC][PATCH] rcu: Use typeof(p) instead of typeof(*p) * To: Mathieu Desnoyers Cc: rostedt , linux-kernel , Linus Torvalds , Paul , Josh Triplett , Lai Jiangshan , "Joel Fernandes, Google" , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , rcu , netfilter-devel , coreteam , netdev References: <20211005094728.203ecef2@gandalf.local.home> <639278914.2878.1633457192964.JavaMail.zimbra@efficios.com> From: Rasmus Villemoes Message-ID: Date: Tue, 5 Oct 2021 20:48:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <639278914.2878.1633457192964.JavaMail.zimbra@efficios.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/10/2021 20.06, Mathieu Desnoyers wrote: > ----- On Oct 5, 2021, at 2:01 PM, Rasmus Villemoes linux@rasmusvillemoes.dk wrote: > >> I would think that one could avoid that churn by saying >> >> typeof((p) + 0) >> >> instead of just "typeof(p)", to force the decay to a pointer. > > Also, AFAIU, the compiler wants to know the sizeof(p) in order to evaluate > (p + 0). Steven's goal is to hide the structure declaration, so that would > not work either. Gah, you're right. I was hoping the frontend would see that +0 could be optimized away and only affect the type of the expression, but it does give 'error: invalid use of undefined type ‘struct abc’'. Sorry for the noise. Rasmus