]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpu: nova-core: register: allow fields named `offset`
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 18 Jul 2025 07:26:08 +0000 (16:26 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Fri, 15 Aug 2025 03:02:51 +0000 (12:02 +0900)
commitc5aeb264b6b27c52fc6c9ef3b50eaaebff5d9b60
tree0130e938d3247a2b50d7b002d6e2f8fed10e58ad
parentbe3536a4bdda53ff5a91b7e542b167d12bddb317
gpu: nova-core: register: allow fields named `offset`

`offset` is a common field name, yet using it triggers a build error due
to the conflict between the uppercased field constant (which becomes
`OFFSET` in this case) containing the bitrange of the field, and the
`OFFSET` constant constaining the offset of the register.

Fix this by adding `_RANGE` the field's range constant to avoid the
name collision.

[acourbot@nvidia.com: fix merge conflict due to switch from `as u32` to
`u32::from`.]

Reported-by: Timur Tabi <ttabi@nvidia.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20250718-nova-regs-v2-3-7b6a762aa1cd@nvidia.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
drivers/gpu/nova-core/regs.rs
drivers/gpu/nova-core/regs/macros.rs