Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] Mismatch between commit message and code: missing BAR1_SIZE constant.
--

commit db55f37382f142c32f879637ebd2448ef45bd83e
Author: Joel Fernandes <[email protected]>

gpu: nova-core: Add BAR1 aperture type and size constant

This commit adds the Bar1 type alias and related GSP structures for BAR1
memory access functionality. It also adds parsing for the BAR1 PDE base
address.

>     gpu: nova-core: Add BAR1 aperture type and size constant
>     
>     Add BAR1_SIZE constant and Bar1 type alias for the 256MB BAR1 aperture.

[Severity: Medium]
Is the BAR1_SIZE constant missing from this patch?

The commit message explicitly states that a BAR1_SIZE constant is added,
but it appears to be entirely missing from the changes.

Note that this omission does not cause runtime bounds checks to fail, as
pci::Bar gracefully falls back to dynamic runtime bounds checks against the
actual PCI resource length. However, there is a mismatch between the intended
change described in the commit message and the actual code.

> diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs
> index 8cef4c284277f..5723ff8f71ea4 100644
> --- a/drivers/gpu/nova-core/driver.rs
> +++ b/drivers/gpu/nova-core/driver.rs
> @@ -38,6 +38,8 @@ pub(crate) struct NovaCore<'bound> {
>  
>  pub(crate) type Bar0<'a> = &'a pci::Bar<'a, BAR0_SIZE>;
>  pub(crate) type NovaRegisters = kernel::io::Region<BAR0_SIZE>;
> +#[expect(dead_code)]
> +pub(crate) type Bar1<'a> = pci::Bar<'a>;

[Severity: Medium]
This is where the Bar1 type alias is defined. Should this include the
promised BAR1_SIZE constant as a generic parameter, similar to Bar0?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=14

Reply via email to