@@ -126,7 +126,7 @@ impl UserSlicePtr {
126
126
/// mapped, writable memory (in which case some data from before the
127
127
/// fault may be written), or `data` is larger than the user slice
128
128
/// (in which case no data is written).
129
- pub fn write_all ( self , data : & [ u8 ] ) -> KernelResult < ( ) > {
129
+ pub fn write_all ( self , data : & [ u8 ] ) -> KernelResult {
130
130
self . writer ( ) . write_slice ( data)
131
131
}
132
132
@@ -180,7 +180,7 @@ impl UserSlicePtrReader {
180
180
/// Returns `EFAULT` if the byte slice is bigger than the remaining size
181
181
/// of the user slice or if the address does not currently point to mapped,
182
182
/// readable memory.
183
- pub fn read_slice ( & mut self , data : & mut [ u8 ] ) -> KernelResult < ( ) > {
183
+ pub fn read_slice ( & mut self , data : & mut [ u8 ] ) -> KernelResult {
184
184
// SAFETY: The output buffer is valid as it's coming from a live reference.
185
185
unsafe { self . read_raw ( data. as_mut_ptr ( ) , data. len ( ) ) }
186
186
}
@@ -190,7 +190,7 @@ impl UserSlicePtrReader {
190
190
/// # Safety
191
191
///
192
192
/// The output buffer must be valid.
193
- pub unsafe fn read_raw ( & mut self , out : * mut u8 , len : usize ) -> KernelResult < ( ) > {
193
+ pub unsafe fn read_raw ( & mut self , out : * mut u8 , len : usize ) -> KernelResult {
194
194
if len > self . 1 || len > u32:: MAX as usize {
195
195
return Err ( error:: Error :: EFAULT ) ;
196
196
}
@@ -239,7 +239,7 @@ impl UserSlicePtrWriter {
239
239
/// Returns `EFAULT` if the byte slice is bigger than the remaining size
240
240
/// of the user slice or if the address does not currently point to mapped,
241
241
/// writable memory.
242
- pub fn write_slice ( & mut self , data : & [ u8 ] ) -> KernelResult < ( ) > {
242
+ pub fn write_slice ( & mut self , data : & [ u8 ] ) -> KernelResult {
243
243
// SAFETY: The input buffer is valid as it's coming from a live reference.
244
244
unsafe { self . write_raw ( data. as_ptr ( ) , data. len ( ) ) }
245
245
}
@@ -249,7 +249,7 @@ impl UserSlicePtrWriter {
249
249
/// # Safety
250
250
///
251
251
/// The input buffer must be valid.
252
- unsafe fn write_raw ( & mut self , data : * const u8 , len : usize ) -> KernelResult < ( ) > {
252
+ unsafe fn write_raw ( & mut self , data : * const u8 , len : usize ) -> KernelResult {
253
253
if len > self . 1 || len > u32:: MAX as usize {
254
254
return Err ( error:: Error :: EFAULT ) ;
255
255
}
0 commit comments