Alexandre Courbot
2025-Jul-14 03:11 UTC
[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 at gmail.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 at nvidia.com/