Lines Matching full:safety

59 // SAFETY: `DeviceId` is a `#[repr(transparent)]` wrapper of `i2c_device_id` and does not add
65 // SAFETY: `DRIVER_DATA_OFFSET` is the offset to the `driver_data` field.
84 // SAFETY:
95 // SAFETY: A call to `unregister` for a given instance of `DriverType` is guaranteed to be valid if
123 // SAFETY: It's safe to set the fields of `struct i2c_client` on initialization. in register()
134 // SAFETY: `idrv` is guaranteed to be a valid `DriverType`. in register()
139 // SAFETY: `idrv` is guaranteed to be a valid `DriverType`. in unregister()
146 // SAFETY: The I2C bus only ever calls the probe callback with a valid pointer to a in probe_callback()
153 // SAFETY: `idev` matched data is of type `Self::IdInfo`. in probe_callback()
166 // SAFETY: `idev` is a valid pointer to a `struct i2c_client`. in remove_callback()
169 // SAFETY: `remove_callback` is only ever called after a successful call to in remove_callback()
178 // SAFETY: `shutdown_callback` is only ever called for a valid `idev` in shutdown_callback()
181 // SAFETY: `shutdown_callback` is only ever called after a successful call to in shutdown_callback()
200 // SAFETY: in i2c_id_info()
209 // SAFETY: `DeviceId` is a `#[repr(transparent)` wrapper of `struct i2c_device_id` and in i2c_id_info()
213 // SAFETY: `id` comes from `table` which is of type `IdArray<_, Self::IdInfo>`. in i2c_id_info()
392 // SAFETY: `self.as_raw` is a valid pointer to a `struct i2c_adapter`. in index()
399 // SAFETY: `index` must refer to a valid I2C adapter; the kernel in get()
404 // SAFETY: `adapter` is non-null and points to a live `i2c_adapter`. in get()
412 // SAFETY: `I2cAdapter` is a transparent wrapper of a type that doesn't depend on
417 // SAFETY: Instances of `I2cAdapter` are always reference-counted.
421 // SAFETY: The existence of a shared reference guarantees that the refcount is non-zero. in inc_ref()
427 // SAFETY: The safety requirements guarantee that the refcount is non-zero. in dec_ref()
484 // SAFETY: `I2cClient` is a transparent wrapper of `struct i2c_client`.
490 // SAFETY: `I2cClient` is a transparent wrapper of a type that doesn't depend on
495 // SAFETY: Instances of `I2cClient` are always reference-counted.
498 // SAFETY: The existence of a shared reference guarantees that the refcount is non-zero. in inc_ref()
503 // SAFETY: The safety requirements guarantee that the refcount is non-zero. in dec_ref()
511 // SAFETY: By the type invariant of `Self`, `self.as_raw()` is a pointer to a valid in as_ref()
515 // SAFETY: `dev` points to a valid `struct device`. in as_ref()
524 // SAFETY: By the type invariant of `Device`, `dev.as_raw()` is a valid pointer to a in try_from()
530 // SAFETY: We've just verified that the type of `dev` equals to in try_from()
535 // SAFETY: `idev` is a valid pointer to a `struct i2c_client`. in try_from()
540 // SAFETY: A `I2cClient` is always reference-counted and can be released from any thread.
543 // SAFETY: `I2cClient` can be shared among threads because all methods of `I2cClient`
570 // SAFETY: the kernel guarantees that `i2c_new_client_device()` returns either a valid in try_new()
585 // SAFETY: `Drop` is only called for a valid `Registration`, which by invariant in drop()
591 // SAFETY: A `Registration` of a `struct i2c_client` can be released from any thread.
594 // SAFETY: `Registration` offers no interior mutability (no mutation through &self