Lines Matching full:safety

34 // SAFETY:
45 // SAFETY: A call to `unregister` for a given instance of `DriverType` is guaranteed to be valid if
53 // SAFETY: It's safe to set the fields of `struct usb_driver` on initialization.
61 // SAFETY: `udrv` is guaranteed to be a valid `DriverType`.
68 // SAFETY: `udrv` is guaranteed to be a valid `DriverType`.
78 // SAFETY: The USB core only ever calls the probe callback with a valid pointer to a
85 // SAFETY: `DeviceId` is a `#[repr(transparent)]` wrapper of `struct usb_device_id` and
89 // SAFETY: `id` comes from `T::ID_TABLE` which is of type `IdArray<_, T::IdInfo>`. It
102 // SAFETY: The USB core only ever calls the disconnect callback with a valid pointer to a
110 // SAFETY: `disconnect_callback` is only ever called after a successful call to
228 // SAFETY: `DeviceId` is a `#[repr(transparent)]` wrapper of `usb_device_id` and does not add
234 // SAFETY: `DRIVER_DATA_OFFSET` is the offset to the `driver_info` field.
342 // SAFETY: `usb::Interface` is a transparent wrapper of `struct usb_interface`.
348 // SAFETY: `Interface` is a transparent wrapper of a type that doesn't depend on
355 // SAFETY: By the type invariant of `Self`, `self.as_raw()` is a pointer to a valid
359 // SAFETY: `dev` points to a valid `struct device`.
366 // SAFETY: `self.as_raw()` is valid by the type invariants.
369 // SAFETY: For a valid `struct usb_interface` pointer, the above call to
375 // SAFETY: Instances of `Interface` are always reference-counted.
379 // SAFETY: The invariants of `Interface` guarantee that `self.as_raw()`
387 // SAFETY: The safety requirements guarantee that the refcount is non-zero.
392 // SAFETY: A `Interface` is always reference-counted and can be released from any thread.
395 // SAFETY: It is safe to send a &Interface to another thread because we do not
423 // SAFETY: `Device` is a transparent wrapper of a type that doesn't depend on `Device`'s generic
428 // SAFETY: Instances of `Device` are always reference-counted.
432 // SAFETY: The invariants of `Device` guarantee that `self.as_raw()`
440 // SAFETY: The safety requirements guarantee that the refcount is non-zero.
447 // SAFETY: By the type invariant of `Self`, `self.as_raw()` is a pointer to a valid
451 // SAFETY: `dev` points to a valid `struct device`.
456 // SAFETY: A `Device` is always reference-counted and can be released from any thread.
459 // SAFETY: It is safe to send a &Device to another thread because we do not
463 // SAFETY: Same as `Device<Normal>` -- the underlying `struct usb_device` is the same;
464 // `Bound` is a zero-sized type-state marker that does not affect thread safety.