@@ -23,9 +23,9 @@ use crate::str::CStr;
2323///
2424/// # Invariants
2525///
26- /// - [`self.0`] is valid and non-null.
27- /// - [`(*self.0).ops`] is valid, non-null and has static lifetime.
28- /// - [`(*self.0).owner`] is valid and, if non-null, has module lifetime.
26+ /// - [`self.0`] is valid and non-null.
27+ /// - [`(*self.0).ops`] is valid, non-null and has static lifetime.
28+ /// - [`(*self.0).owner`] is valid and, if non-null, has module lifetime.
2929struct Cdev ( * mut bindings:: cdev ) ;
3030
3131impl Cdev {
@@ -45,20 +45,20 @@ impl Cdev {
4545 ( * cdev) . owner = module. 0 ;
4646 }
4747 // INVARIANTS:
48- // - [`self.0`] is valid and non-null.
49- // - [`(*self.0).ops`] is valid, non-null and has static lifetime,
50- // because it was coerced from a reference with static lifetime.
51- // - [`(*self.0).owner`] is valid and, if non-null, has module lifetime,
52- // guaranteed by the [`ThisModule`] invariant.
48+ // - [`self.0`] is valid and non-null.
49+ // - [`(*self.0).ops`] is valid, non-null and has static lifetime,
50+ // because it was coerced from a reference with static lifetime.
51+ // - [`(*self.0).owner`] is valid and, if non-null, has module lifetime,
52+ // guaranteed by the [`ThisModule`] invariant.
5353 Ok ( Self ( cdev) )
5454 }
5555
5656 fn add ( & mut self , dev : bindings:: dev_t , count : c_types:: c_uint ) -> Result {
57- // SAFETY: according to the type invariants:
58- // - [`self.0`] can be safely passed to [`bindings::cdev_add`].
59- // - [`(*self.0).ops`] will live at least as long as [`self.0`].
60- // - [`(*self.0).owner`] will live at least as long as the
61- // module, which is an implicit requirement.
57+ // SAFETY: According to the type invariants:
58+ // - [`self.0`] can be safely passed to [`bindings::cdev_add`].
59+ // - [`(*self.0).ops`] will live at least as long as [`self.0`].
60+ // - [`(*self.0).owner`] will live at least as long as the
61+ // module, which is an implicit requirement.
6262 let rc = unsafe { bindings:: cdev_add ( self . 0 , dev, count) } ;
6363 if rc != 0 {
6464 return Err ( Error :: from_kernel_errno ( rc) ) ;
0 commit comments