Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4974402pxb; Tue, 5 Oct 2021 14:36:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6hmZY0LJ48sT/YqmPx9N1X0+NRc53i9c3gD12VTeFFGO0qf+QvfkG3wGKU5IiQU+YL7Qb X-Received: by 2002:a17:906:5801:: with SMTP id m1mr813891ejq.296.1633469775920; Tue, 05 Oct 2021 14:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633469775; cv=none; d=google.com; s=arc-20160816; b=qJkCPe+jaO2zpdTEMCXOczcneDDc+c3fWtNY9qXza1p5bE4wtBxG/ixcLUasVCUaTf eHQ+lT0/+WKj3wcyD8DfiwwDSgDTsI1aN3rW/PA2OkeXhIHLHa9dwU3hNXdHePRyixVg z8XFWTnCDRCWIj9smwHHREXOUqR7drnvNOkUUUmrB5Iat6hHk7c5WEWzzQTZJYOSDOGQ Fqd6XBcHZ0Oz3dDHVNEabc1rnKT09WtFyRGcZ/bd5CnPspP4ThYdvudstb63xLsJ1LL6 rRbDfuWS/skDBIW2eM9zEFzKskb07Ath46VADOv3NqFA8Zh/R+ooQojEahDmrZKRyGH/ vvuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=K7jQ1mmWi2XBmpgAPcJ8NJOBcFNqeNIIIqJq69SJlXI=; b=Ye8W8dRAM7oTrOw1SpmPgIfZFk3lffe43CQL92EqStHdTgno+ogqoVZNyU05LLHZJ3 5Z1yF8X/uHPWpoFGuM/6fBA/8dCKDAH22amWlcwLA6/87wEMRxU46f8VkeL+WnOlazSw 4dSrn4Tg+geU9enr5pKt4yJE+HLo1nP8FPR6Nr1FgDrEQfGgC84G2GpJC8soBiApNq2j PRc1RmAhzKUB0/6+a980QX2Ak6VyfP6CQQaF5NLbGMC1foBWVT8VFPlrlNNoN0Lz9Zv8 b6lA9gUJEq88eTw9wid0xtr73VRlImS0Hcx3Zd3exMJcSTU/mVIH52mcTJeqyajM93I8 mJOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=aqmi0Vcn; 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 v14si1583338edb.187.2021.10.05.14.35.42; Tue, 05 Oct 2021 14:36:15 -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=@linux-foundation.org header.s=google header.b=aqmi0Vcn; 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 S236259AbhJEVf4 (ORCPT + 99 others); Tue, 5 Oct 2021 17:35:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235957AbhJEVfy (ORCPT ); Tue, 5 Oct 2021 17:35:54 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE0B6C061749 for ; Tue, 5 Oct 2021 14:34:03 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id y15so1624492lfk.7 for ; Tue, 05 Oct 2021 14:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=K7jQ1mmWi2XBmpgAPcJ8NJOBcFNqeNIIIqJq69SJlXI=; b=aqmi0VcnQ1JDOG+62KHNkPCW9psm3Gc6I0WmwAmeqOHaqPxliahcaOEbptUWdB27P7 TVvOUr1XDPRcbTiUrvwEYTrrA6U7YHnWyjQWHv9VYsTcw+eKDp1YRbSzqXp42CGdFQm/ dlspqoxgRfSifvqYNBCP8cB8iMfjHRGMisfOY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K7jQ1mmWi2XBmpgAPcJ8NJOBcFNqeNIIIqJq69SJlXI=; b=nxXQQeEVYhXL9f1EtdnqImXuytF7LduDAzqcxgU1ITBUiQAwdnj8ZKjB9Nj9aH2WY7 EAg+Zeriv0HoWORQOA6UHcbgdtVedQB+AGp/S+Wvkqx2WIBtygRqBc7CYVsDiGUqJgoV geM1+akZkkmngL1+ZMNdhUjqll+E36igpuXwLRxZKiuVRDD7lUZtgrq2mrTz2NQg+oUu GcDEoKGi0RCJXLmCxhCKa+bBfudJGpaiLcP6VFstA4Rtv92z68S9z0T9ljIVrRPaVha1 MmOKDf1u0u/e/oRcE5vBFUGfKEZJZT5KJbPQMB3LLXSu6r7HMIaFIv8ckJpH9/IZ6QF0 RMTw== X-Gm-Message-State: AOAM533M4v4pqqc6yJyHzb3RfGreeXXjeEKmrSm+iTnRnIbTM4sdU0ZQ GDpLHSNs/F/cbbLhC2Omp4iJX12J80RODm4YKUI= X-Received: by 2002:a05:6512:1053:: with SMTP id c19mr5734933lfb.283.1633469641875; Tue, 05 Oct 2021 14:34:01 -0700 (PDT) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id s13sm832062lfp.288.2021.10.05.14.34.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 14:34:01 -0700 (PDT) Received: by mail-lf1-f46.google.com with SMTP id i4so1691494lfv.4 for ; Tue, 05 Oct 2021 14:34:01 -0700 (PDT) X-Received: by 2002:a2e:5815:: with SMTP id m21mr24761572ljb.95.1633469286442; Tue, 05 Oct 2021 14:28:06 -0700 (PDT) MIME-Version: 1.0 References: <20211005094728.203ecef2@gandalf.local.home> <639278914.2878.1633457192964.JavaMail.zimbra@efficios.com> <826o327o-3r46-3oop-r430-8qr0ssp537o3@vanv.qr> <20211005144002.34008ea0@gandalf.local.home> <20211005154029.46f9c596@gandalf.local.home> <20211005163754.66552fb3@gandalf.local.home> In-Reply-To: From: Linus Torvalds Date: Tue, 5 Oct 2021 14:27:49 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH] rcu: Use typeof(p) instead of typeof(*p) * To: Jan Engelhardt Cc: Steven Rostedt , Mathieu Desnoyers , Rasmus Villemoes , linux-kernel , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 5, 2021 at 2:09 PM Jan Engelhardt wrote: > > Illegal. > https://en.cppreference.com/w/c/language/conversion > subsection "Pointer conversion" > "No other guarantees are offered" Well, we happily end up casting pointers to 'unsigned long' and back, and doing bit games on the low bits of a pointer value. So it's not like the kernel deeply cares about theoretical portability. But I do discourage casting when not required, just because as much static type checking we can possibly have is good when we can do it. Linus