From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6017DC433EF for ; Tue, 5 Oct 2021 21:34:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3FEE9615E1 for ; Tue, 5 Oct 2021 21:34:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236636AbhJEVf4 (ORCPT ); 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-Google-Smtp-Source: ABdhPJxTzWQ3o6m8LanC2dRy4/wO2eV+m+1HsbK7uzkA432FdBc+Rn8E3lL6rT4eZfbUvhOl5/NFKw== 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