Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Missing invariant comment for `DebugfsData` construction --
commit f5ca13df2d92dfa80fcdd81e199934e5ce48a7c2 Author: Vladislav Zaharov <[email protected]> gpu: nova-core: move the debugfs root into the module data This commit moves the debugfs root directory into a new DebugfsData structure owned by the module, instead of using a static mut with a guard type. This prevents leaks where a failing driver registration would leave the directory lingering. > diff --git a/drivers/gpu/nova-core/nova_core.rs > b/drivers/gpu/nova-core/nova_core.rs > --- a/drivers/gpu/nova-core/nova_core.rs > +++ b/drivers/gpu/nova-core/nova_core.rs [ ... ] > +impl DebugfsData { > + /// Creates the shared data and publishes it, so that [`debugfs_data()`] > can hand it out. > + fn new() -> impl PinInit<Self> { > + pin_init!(&this in Self { > + root: debugfs::Dir::new(c"nova-core"), > + _: { > + // SAFETY: Module initialization runs once and before the > driver is registered, so > + // nothing can be reading `DEBUGFS_DATA` while it is written > here. `this` is where > + // the data is being built, and it stays there: the module > data never moves. > + unsafe { DEBUGFS_DATA = this.as_ptr() }; > + }, > + }) > + } [Severity: Low] Is an // INVARIANT: comment missing here? DebugfsData has a documented invariant, and is being constructed here via pin_init!, but there is no comment explaining how the invariants are satisfied. [ ... ] -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=1
