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: add bus callback sriov_configure(), to control SR-IOV from sysfs Date: Wed, 04 Mar 2026 08:40:16 +1000 Message-ID: In-Reply-To: <20260303-rust-pci-sriov-v3-5-4443c35f0c88@redhat.com> References: <20260303-rust-pci-sriov-v3-0-4443c35f0c88@redhat.com> <20260303-rust-pci-sriov-v3-5-4443c35f0c88@redhat.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review The callback plumbing is correct. The `sriov_configure_callback` uses `from_result()` which correctly maps `Result` to C int (negative for error, non-negative for success). ```rust + #[cfg(CONFIG_PCI_IOV)] + if T::HAS_SRIOV_CONFIGURE { + (*pdrv.get()).sriov_configure = Some(Self::sriov_configure_callback); + } ``` The conditional registration using `HAS_SRIOV_CONFIGURE` (from the `#[vtable]` attribute) means `sriov_configure` is only set in the C `pci_driver` when the Rust driver actually implements it. This is important because `pci_iov_disable()` checks `!drv->sriov_configure` to decide whether to call the callback or fall back to `sriov_disable()` directly. The doc comment example correctly shows usage but the `#[cfg(CONFIG_PCI_IOV)]` on the free function is mildly confusing since the method itself is already cfg-gated on the trait. --- Generated by Claude Code Patch Reviewer