summaryrefslogtreecommitdiff
path: root/drivers/gpu/nova-core
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2025-07-18 10:26:18 +0300
committerAlexandre Courbot <acourbot@nvidia.com>2025-08-15 06:02:56 +0300
commitfcdce54d645a0779892faaed1209105350e15d92 (patch)
treeba1c61079d1f85ae50b9caa9b01016fb5460036d /drivers/gpu/nova-core
parent3fa145bef533f899ed6de641fe99c70028e28481 (diff)
downloadlinux-fcdce54d645a0779892faaed1209105350e15d92.tar.xz
gpu: nova-core: register: split @io rule into fixed and relative versions
We used the same @io rule with different patterns to define both the fixed and relative I/O accessors. This can be confusing as the matching rules are very similar. Since all call sites know which version they want to call, split @io into @io_fixed and @io_relative to remove any ambiguity. 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-13-7b6a762aa1cd@nvidia.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Diffstat (limited to 'drivers/gpu/nova-core')
-rw-r--r--drivers/gpu/nova-core/regs/macros.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nova-core/regs/macros.rs b/drivers/gpu/nova-core/regs/macros.rs
index e43e1ab7ae2e..432af02b3378 100644
--- a/drivers/gpu/nova-core/regs/macros.rs
+++ b/drivers/gpu/nova-core/regs/macros.rs
@@ -89,25 +89,25 @@ macro_rules! register {
// Creates a register at a fixed offset of the MMIO space.
($name:ident @ $offset:literal $(, $comment:literal)? { $($fields:tt)* } ) => {
register!(@core $name $(, $comment)? { $($fields)* } );
- register!(@io $name @ $offset);
+ register!(@io_fixed $name @ $offset);
};
// Creates an alias register of fixed offset register `alias` with its own fields.
($name:ident => $alias:ident $(, $comment:literal)? { $($fields:tt)* } ) => {
register!(@core $name $(, $comment)? { $($fields)* } );
- register!(@io $name @ $alias::OFFSET);
+ register!(@io_fixed $name @ $alias::OFFSET);
};
// Creates a register at a relative offset from a base address.
($name:ident @ + $offset:literal $(, $comment:literal)? { $($fields:tt)* } ) => {
register!(@core $name $(, $comment)? { $($fields)* } );
- register!(@io $name @ + $offset);
+ register!(@io_relative $name @ + $offset);
};
// Creates an alias register of relative offset register `alias` with its own fields.
($name:ident => + $alias:ident $(, $comment:literal)? { $($fields:tt)* } ) => {
register!(@core $name $(, $comment)? { $($fields)* } );
- register!(@io $name @ + $alias::OFFSET);
+ register!(@io_relative $name @ + $alias::OFFSET);
};
// All rules below are helpers.
@@ -342,7 +342,7 @@ macro_rules! register {
};
// Generates the IO accessors for a fixed offset register.
- (@io $name:ident @ $offset:expr) => {
+ (@io_fixed $name:ident @ $offset:expr) => {
#[allow(dead_code)]
impl $name {
pub(crate) const OFFSET: usize = $offset;
@@ -380,7 +380,7 @@ macro_rules! register {
};
// Generates the IO accessors for a relative offset register.
- (@io $name:ident @ + $offset:literal) => {
+ (@io_relative $name:ident @ + $offset:literal) => {
#[allow(dead_code)]
impl $name {
pub(crate) const OFFSET: usize = $offset;