diff options
| author | Thomas Zimmermann <tzimmermann@suse.de> | 2026-09-07 13:44:24 +0200 |
|---|---|---|
| committer | Thomas Zimmermann <tzimmermann@suse.de> | 2026-09-07 13:44:24 +0200 |
| commit | 3ab04dcce43cd4fdaed94f08f4e6289be4921ea4 (patch) | |
| tree | 61229f2644f48301f9d09722e390295cb55a2cf4 /rust/kernel | |
| parent | a9f09b5ea0c3db1e2d4c0f8d3ebdd612d8aa0366 (diff) | |
| parent | df2908090cda368b01ff43709f51890076c56157 (diff) | |
Merge drm/drm-next into drm-misc-next
Backmerging to get drm-misc-next up to v7.3-rc2. Requested for
commit 3a2c4d55e32a ("treewide: refresh kmalloc_obj() conversions").
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'rust/kernel')
| -rw-r--r-- | rust/kernel/pci/irq.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rust/kernel/pci/irq.rs b/rust/kernel/pci/irq.rs index 6741046ec1c0..22e2cdf82a21 100644 --- a/rust/kernel/pci/irq.rs +++ b/rust/kernel/pci/irq.rs @@ -151,8 +151,10 @@ impl<'a> IrqVectorRegistration<'a> { /// [`Self::len()`]. #[inline] pub fn index(&self, index: usize) -> Result<IrqVector<'_>> { + let index = u32::try_from(index)?; + // SAFETY: `self.dev.as_raw()` is a valid pointer to a `struct pci_dev`. - let irq = unsafe { bindings::pci_irq_vector(self.dev.as_raw(), index as u32) }; + let irq = unsafe { bindings::pci_irq_vector(self.dev.as_raw(), index) }; if irq < 0 { return Err(Error::from_errno(irq)); } |
