]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: pci: use c_* types via kernel prelude
authorAbhinav Ananthu <abhinav.ogl@gmail.com>
Tue, 12 Aug 2025 03:31:02 +0000 (09:01 +0530)
committerDanilo Krummrich <dakr@kernel.org>
Fri, 15 Aug 2025 18:05:20 +0000 (20:05 +0200)
Update PCI FFI callback signatures to use `c_` from the prelude,
instead of accessing it via `kernel::ffi::`.

Signed-off-by: Abhinav Ananthu <abhinav.ogl@gmail.com>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Link: https://lore.kernel.org/r/20250812033101.5257-1-abhinav.ogl@gmail.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/pci.rs

index 3bf1737635a9e219c3eec3f4c5f8e4e07b553b86..71d25dbcb392bbf1f8dacbd2fc8291f7163b9ba2 100644 (file)
@@ -60,7 +60,7 @@ impl<T: Driver + 'static> Adapter<T> {
     extern "C" fn probe_callback(
         pdev: *mut bindings::pci_dev,
         id: *const bindings::pci_device_id,
-    ) -> kernel::ffi::c_int {
+    ) -> c_int {
         // SAFETY: The PCI bus only ever calls the probe callback with a valid pointer to a
         // `struct pci_dev`.
         //
@@ -347,7 +347,7 @@ impl<const SIZE: usize> Bar<SIZE> {
         // `ioptr` is valid by the safety requirements.
         // `num` is valid by the safety requirements.
         unsafe {
-            bindings::pci_iounmap(pdev.as_raw(), ioptr as *mut kernel::ffi::c_void);
+            bindings::pci_iounmap(pdev.as_raw(), ioptr as *mut c_void);
             bindings::pci_release_region(pdev.as_raw(), num);
         }
     }