rust: pci: use c_* types via kernel prelude
PATCH v3 1/1 rust: pci: use c_* types via kernel prelude
From: Abhinav Ananthu <[email protected]>
Update PCI FFI callback signatures to use c_ from the prelude, instead of accessing it via kernel::ffi::.
Signed-off-by Abhinav Ananthu <[email protected]>
--- rust/kernel/pci.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
rust/kernel/pci.rs +2 -2
@@ -61,7 +61,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`. //
@@ -333,7 +333,7 @@ unsafe fn do_release(pdev: &Device, ioptr: usize, num: i32) {// `ioptr` is valid by the safety requirements. // `num` is valid by the safety requirements. unsafe { - bindings::pci_iounmap (pdev.as_raw (), ioptras *mut kernel::ffi::c_void ); + bindings::pci_iounmap (pdev.as_raw (), ioptras *mut c_void ); bindings::pci_release_region (pdev.as_raw (), num); } }
Signature · 1 line
2.34.1
Danilo Krummrich
maintainerQuoted 6 lines · herculoxz
From: Abhinav Ananthu <[email protected]>
Update PCI FFI callback signatures to use
c_from the prelude, instead of accessing it viakernel::ffi::.Signed-off-by Abhinav Ananthu <[email protected]>
Applied to driver-core-testing, thanks!