summaryrefslogtreecommitdiff
path: root/rust/kernel/opp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/kernel/opp.rs')
-rw-r--r--rust/kernel/opp.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/rust/kernel/opp.rs b/rust/kernel/opp.rs
index f9641c639fff..a760fac28765 100644
--- a/rust/kernel/opp.rs
+++ b/rust/kernel/opp.rs
@@ -13,7 +13,7 @@ use crate::{
cpumask::{Cpumask, CpumaskVar},
device::Device,
error::{code::*, from_err_ptr, from_result, to_result, Result, VTABLE_DEFAULT_ERROR},
- ffi::c_ulong,
+ ffi::{c_char, c_ulong},
prelude::*,
str::CString,
sync::aref::{ARef, AlwaysRefCounted},
@@ -88,12 +88,12 @@ use core::{marker::PhantomData, ptr};
use macros::vtable;
/// Creates a null-terminated slice of pointers to [`CString`]s.
-fn to_c_str_array(names: &[CString]) -> Result<KVec<*const u8>> {
+fn to_c_str_array(names: &[CString]) -> Result<KVec<*const c_char>> {
// Allocated a null-terminated vector of pointers.
let mut list = KVec::with_capacity(names.len() + 1, GFP_KERNEL)?;
for name in names.iter() {
- list.push(name.as_ptr().cast(), GFP_KERNEL)?;
+ list.push(name.as_char_ptr(), GFP_KERNEL)?;
}
list.push(ptr::null(), GFP_KERNEL)?;