[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DBBG6Q86XAAQ.43DPC0D210TI@nvidia.com>
Date: Mon, 14 Jul 2025 12:11:57 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Rhys Lloyd" <krakow20@...il.com>, <dakr@...nel.org>
Cc: <airlied@...il.com>, <simona@...ll.ch>, <nouveau@...ts.freedesktop.org>,
<dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
<rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH] gpu: nova-core: define named constants for magic
numbers
On Sun Jul 13, 2025 at 11:51 AM JST, Rhys Lloyd wrote:
> Introduce an associated constant `MIN_LEN` for each struct that checks
> the length of the input data in its constructor against a magic number.
>
> Signed-off-by: Rhys Lloyd <krakow20@...il.com>
As I mentioned in [1], I think this would be better addressed by working
in terms of `sizeof` upon the relevant structures, after making them
`#[repr(C)]`. It might require splitting them a bit since some contain
other data (or we can maybe turn them into DSTs).
[1] https://lore.kernel.org/rust-for-linux/DB97X8JAJFI4.3G1I8ZPC1MWLS@nvidia.com/
Powered by blists - more mailing lists