From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: pci: make Driver trait lifetime-parameterized Date: Thu, 07 May 2026 13:02:04 +1000 Message-ID: In-Reply-To: <20260506215113.851360-11-dakr@kernel.org> References: <20260506215113.851360-1-dakr@kernel.org> <20260506215113.851360-11-dakr@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This is where the ergonomic payoff starts. The `pci::Driver` trait becomes: ```rust pub trait Driver<'bound>: Send { fn probe( pdev: &'bound Device, info: &'bound Self::IdInfo, ) -> impl PinInit + 'bound; fn unbind(pdev: &'bound Device, this: Pin<&'bound Self>) { ... } } ``` The `Adapter` is parameterized over `F: ForLt` with the HRTB bound `for<'bound> F::Of<'bound>: Driver<'bound>`. The `module_pci_driver!` macro wraps the type: `ForLt!($type)`. Well structured. The HRTB on `Adapter` is the key mechanism: it says "for any lifetime `'bound`, the instantiated type implements `Driver<'bound>`", which is what lets the framework pick the right lifetime at probe time. No issues found. ### PATCHES 11-16: make Driver lifetime-parameterized (platform, auxiliary, auxiliary Registration, usb, i2c) All follow the same pattern as patch 10 for their respective bus types. The auxiliary `Registration` generalization (patch 13) is notable -- it extends the lifetime-bound pattern beyond driver private data to registration data, which is a good demonstration of the generality. The sample in patch 14 showcases this well, storing a `&'bound pci::Device` in auxiliary registration data. No issues found. --- Generated by Claude Code Patch Reviewer