Lines Matching full:safety

44 // SAFETY:
55 // SAFETY: A call to `unregister` for a given instance of `DriverType` is guaranteed to be valid if
63 // SAFETY: It's safe to set the fields of `struct auxiliary_driver` on initialization.
71 // SAFETY: `adrv` is guaranteed to be a valid `DriverType`.
78 // SAFETY: `adrv` is guaranteed to be a valid `DriverType`.
88 // SAFETY: The auxiliary bus only ever calls the probe callback with a valid pointer to a
94 // SAFETY: `DeviceId` is a `#[repr(transparent)`] wrapper of `struct auxiliary_device_id`
98 // SAFETY: `id` comes from `T::ID_TABLE` which is of type `IdArray<_, T::IdInfo>`.
110 // SAFETY: The auxiliary bus only ever calls the probe callback with a valid pointer to a
116 // SAFETY: `remove_callback` is only ever called after a successful call to
165 // SAFETY: `DeviceId` is a `#[repr(transparent)]` wrapper of `auxiliary_device_id` and does not add
171 // SAFETY: `DRIVER_DATA_OFFSET` is the offset to the `driver_data` field.
251 // SAFETY: By the type invariant `self.as_raw()` is a valid pointer to a
262 // SAFETY: A bound auxiliary device always has a bound parent device.
270 /// # Safety
275 // SAFETY: By the type invariant, `self.as_raw()` is a valid `struct auxiliary_device`.
285 // SAFETY: `ptr` is non-null and was set via `into_foreign()` in `Registration::new()`;
293 // SAFETY: The `TypeId` check above confirms that the stored type matches `F`'s
299 // SAFETY: `data` is a structurally pinned field of `RegistrationData`.
321 // SAFETY: The HRTB closure prevents the caller from smuggling in references with a
343 // SAFETY: `CovariantForLt` guarantees covariance, which makes the lifetime shortening
352 // SAFETY: A `struct auxiliary_device` always has a parent.
357 // SAFETY: By the type invariant `self.0.as_raw` is a pointer to the `struct device`
361 // SAFETY: `adev` points to the memory that has been allocated in `Registration::new`, via
367 // SAFETY: `auxiliary::Device` is a transparent wrapper of `struct auxiliary_device`.
373 // SAFETY: `Device` is a transparent wrapper of a type that doesn't depend on `Device`'s generic
378 // SAFETY: Instances of `Device` are always reference-counted.
381 // SAFETY: The existence of a shared reference guarantees that the refcount is non-zero.
389 // SAFETY: By the type invariant of `Self`, `adev` is a pointer to a valid
393 // SAFETY: The safety requirements guarantee that the refcount is non-zero.
400 // SAFETY: By the type invariant of `Self`, `self.as_raw()` is a pointer to a valid
404 // SAFETY: `dev` points to a valid `struct device`.
409 // SAFETY: A `Device` is always reference-counted and can be released from any thread.
412 // SAFETY: `Device` can be shared among threads because all methods of `Device`
416 // SAFETY: Same as `Device<Normal>` -- the underlying `struct auxiliary_device` is the same;
417 // `Bound` is a zero-sized type-state marker that does not affect thread safety.
459 /// # Safety
484 // SAFETY: `'a` is invariant (via `Registration`'s `PhantomData`). Lifetimes do not
493 // SAFETY: It's safe to set the fields of `struct auxiliary_device` on initialization.
502 // SAFETY: `adev` is guaranteed to be a valid pointer to a `struct auxiliary_device`,
511 // SAFETY:
517 // SAFETY: `registration_data` was set above via `into_foreign()`.
524 // SAFETY: `adev` is guaranteed to be a valid pointer to a
534 // SAFETY: `adev` is guaranteed to be non-null, since the `KBox` was allocated
556 // SAFETY: `F::Of<'a>: 'static` guarantees the data contains no borrowed references,
564 // SAFETY: By the type invariant of `Self`, `self.adev.as_ptr()` is a valid registered
568 // SAFETY: `registration_data` was set in `new()` via `into_foreign()`.
577 // SAFETY: By the type invariant of `Self`, `self.adev.as_ptr()` is a valid registered
583 // SAFETY: A `Registration` of a `struct auxiliary_device` can be released from any thread.
586 // SAFETY: `Registration` does not expose any methods or fields that need synchronization.