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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3964FD35693 for ; Wed, 28 Jan 2026 10:47:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 874DA10E63F; Wed, 28 Jan 2026 10:47:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="u86qh55p"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id C694110E63F; Wed, 28 Jan 2026 10:47:04 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 801ED40733; Wed, 28 Jan 2026 10:47:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2990C4AF09; Wed, 28 Jan 2026 10:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769597224; bh=xKmKGHblPsSZenvqrZey8InJuq6tz0WVn85z4/keYKU=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=u86qh55pZvVbKWRIoIpanUlPoJfy10TkSP4JTWfZCrSGe+dmfZFd1ZyDBDSycARvb 4b4hd+IJLC+jiK0NFDM2B/P80jirpXwKuS358BRWxyrfQx0JBzDzFdOX1boeIDdhg7 5eZ0NB0p99mzHigmu9Pgum/eidSNbRpTslQHnwJSBeBCcMPLG+WkgQPBNVd1Yq1DL/ QcRZAV3IuKxcbJHc4/LJppHIvUNS2g1G1N5eqRjRi0bUfvjnkwpt9f8IjacXMBk287 imvtYpVwXX9UT6SNHwSh2MoaO5fV9WED5g+7E3/ctPEAIkIDylvru7poUlVAfJnvOf yGpRvNmy3yUJA== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 28 Jan 2026 11:46:59 +0100 Message-Id: Subject: Re: [PATCH v2 2/4] gpu: nova-core: gsp: clarify comments about invariants and pointer roles Cc: "Eliot Courtney" , "Gary Guo" , "Alice Ryhl" , "David Airlie" , "Simona Vetter" , "Alistair Popple" , , , , , "dri-devel" To: "Alexandre Courbot" From: "Danilo Krummrich" References: <20260123-nova-core-cmdq1-v2-0-e797ec1b714c@nvidia.com> <20260123-nova-core-cmdq1-v2-2-e797ec1b714c@nvidia.com> In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed Jan 28, 2026 at 9:17 AM CET, Alexandre Courbot wrote: > On Wed Jan 28, 2026 at 1:35 PM JST, Eliot Courtney wrote: >> On Tue Jan 27, 2026 at 3:04 AM JST, Gary Guo wrote: >>> I wonder if this can be `is within 0..MSGQ_NUM_PAGES`. What do others t= hink? >> >> I think this is very reasonable, since this is part of the rust >> range syntax so it should be understandable. I also considered the >> mathematical syntax `[0, MSGQ_NUM_PAGES)`, but not sure if this would >> be conventional - it does seem that this notation is used in a bunch >> of places though. Will apply your suggestion in the next version unless >> there is a definitive convention for this. > > Since this is Rust code, the Rust syntax to express ranges (within `` > quotes) makes sense IMHO. While I really like the mathematical syntax, I think using the Rust syntax = is superior, as it requires zero mental cycles to translate it to what is like= ly to be found in the code as well. (There also have been some considerations of using tools to validate safety comments or invariants to some extend eventually.)