@@ -150,7 +150,7 @@ unsafe extern "C" fn llseek_callback<T: FileOperations>(
150150 _ => return Err ( Error :: EINVAL ) ,
151151 } ;
152152 let f = & * ( ( * file) . private_data as * const T ) ;
153- let off = T :: seek( f , & File :: from_ptr( file) , off) ?;
153+ let off = f . seek( & File :: from_ptr( file) , off) ?;
154154 Ok ( off as bindings:: loff_t)
155155 }
156156}
@@ -164,7 +164,7 @@ unsafe extern "C" fn unlocked_ioctl_callback<T: FileOperations>(
164164 let f = & * ( ( * file) . private_data as * const T ) ;
165165 // SAFETY: This function is called by the kernel, so it must set `fs` appropriately.
166166 let mut cmd = IoctlCommand :: new( cmd as _, arg as _) ;
167- let ret = T :: ioctl( f , & File :: from_ptr( file) , & mut cmd) ?;
167+ let ret = f . ioctl( & File :: from_ptr( file) , & mut cmd) ?;
168168 Ok ( ret as _)
169169 }
170170}
@@ -178,7 +178,7 @@ unsafe extern "C" fn compat_ioctl_callback<T: FileOperations>(
178178 let f = & * ( ( * file) . private_data as * const T ) ;
179179 // SAFETY: This function is called by the kernel, so it must set `fs` appropriately.
180180 let mut cmd = IoctlCommand :: new( cmd as _, arg as _) ;
181- let ret = T :: compat_ioctl( f , & File :: from_ptr( file) , & mut cmd) ?;
181+ let ret = f . compat_ioctl( & File :: from_ptr( file) , & mut cmd) ?;
182182 Ok ( ret as _)
183183 }
184184}
@@ -194,7 +194,7 @@ unsafe extern "C" fn fsync_callback<T: FileOperations>(
194194 let end = end. try_into( ) ?;
195195 let datasync = datasync != 0 ;
196196 let f = & * ( ( * file) . private_data as * const T ) ;
197- let res = T :: fsync( f , & File :: from_ptr( file) , start, end, datasync) ?;
197+ let res = f . fsync( & File :: from_ptr( file) , start, end, datasync) ?;
198198 Ok ( res. try_into( ) . unwrap( ) )
199199 }
200200}
@@ -386,15 +386,15 @@ impl IoctlCommand {
386386 pub fn dispatch < T : IoctlHandler > ( & mut self , handler : & T , file : & File ) -> KernelResult < i32 > {
387387 let dir = ( self . cmd >> bindings:: _IOC_DIRSHIFT) & bindings:: _IOC_DIRMASK;
388388 if dir == bindings:: _IOC_NONE {
389- return T :: pure ( handler , file, self . cmd , self . arg ) ;
389+ return handler . pure ( file, self . cmd , self . arg ) ;
390390 }
391391
392392 let data = self . user_slice . take ( ) . ok_or ( Error :: EINVAL ) ?;
393393 const READ_WRITE : u32 = bindings:: _IOC_READ | bindings:: _IOC_WRITE;
394394 match dir {
395- bindings:: _IOC_WRITE => T :: write ( handler , file, self . cmd , & mut data. reader ( ) ) ,
396- bindings:: _IOC_READ => T :: read ( handler , file, self . cmd , & mut data. writer ( ) ) ,
397- READ_WRITE => T :: read_write ( handler , file, self . cmd , data) ,
395+ bindings:: _IOC_WRITE => handler . write ( file, self . cmd , & mut data. reader ( ) ) ,
396+ bindings:: _IOC_READ => handler . read ( file, self . cmd , & mut data. writer ( ) ) ,
397+ READ_WRITE => handler . read_write ( file, self . cmd , data) ,
398398 _ => Err ( Error :: EINVAL ) ,
399399 }
400400 }
@@ -531,7 +531,7 @@ impl<T> PointerWrapper<T> for Box<T> {
531531 }
532532
533533 unsafe fn from_pointer ( ptr : * const T ) -> Self {
534- Box :: < T > :: from_raw ( ptr as _ )
534+ Box :: from_raw ( ptr as _ )
535535 }
536536}
537537
@@ -551,6 +551,6 @@ impl<T> PointerWrapper<T> for Arc<T> {
551551 }
552552
553553 unsafe fn from_pointer ( ptr : * const T ) -> Self {
554- Arc :: < T > :: from_raw ( ptr)
554+ Arc :: from_raw ( ptr)
555555 }
556556}
0 commit comments