Lines Matching full:valid

81     /// Creates a reference to a [`Device`] from a valid C pointer.
85 /// The caller must ensure that `ptr` is valid and remains valid for the lifetime of the
100 // SAFETY: `self.as_raw()` provides a valid pointer for `self`'s lifetime.
106 // SAFETY: `self.as_raw()` provides a valid pointer. (*self.as_raw()).chip
107 // is assumed to be a valid pointer to `pwm_chip` managed by the kernel.
114 // SAFETY: self.as_raw() provides a valid pointer.
121 // managed by the kernel, valid for the lifetime of the PWM device.
129 // SAFETY: `self.as_raw()` provides a valid `*mut pwm_device` pointer.
130 // `&c_wf` is a valid pointer to a `pwm_waveform` struct. The C function
140 // SAFETY: `self.as_raw()` provides a valid `*mut pwm_device` pointer.
141 // `&mut c_wf` is a valid pointer to a mutable `pwm_waveform` struct that
160 // SAFETY: `self.as_raw()` is a valid pointer. We provide a valid pointer
251 /// `wfhw_ptr` must be valid for writes of `size_of::<T::WfHw>()` bytes.
257 // SAFETY: The caller ensures `wfhw_ptr` is valid for `size` bytes.
271 /// `wfhw_ptr` must be valid for reads of `size_of::<T::WfHw>()` bytes.
278 // SAFETY: The caller ensures `wfhw_ptr` is valid for `size` bytes.
292 /// `dev` must be a valid pointer to a `bindings::device` embedded within a
297 // field embedded within a valid `pwm_chip`. `container_of!` can therefore
301 // SAFETY: `c_chip_ptr` is a valid pointer to a `pwm_chip` as established
309 // SAFETY: `dev` is the valid pointer passed into this callback, which is
316 /// Pointers from C must be valid.
321 // SAFETY: PWM core guarentees `chip_ptr` and `pwm_ptr` are valid pointers.
334 /// Pointers from C must be valid.
341 // SAFETY: Relies on the function's contract that `chip_ptr` and `pwm_ptr` are valid
361 /// Pointers from C must be valid.
368 // SAFETY: Relies on the function's contract that `chip_ptr` and `pwm_ptr` are valid
379 // SAFETY: `wfhw_ptr` is valid per this function's safety contract.
391 /// Pointers from C must be valid.
398 // SAFETY: Relies on the function's contract that `chip_ptr` and `pwm_ptr` are valid
410 // SAFETY: `wf_ptr` is guaranteed valid by the C caller.
420 /// Pointers from C must be valid.
426 // SAFETY: Relies on the function's contract that `chip_ptr` and `pwm_ptr` are valid
433 // SAFETY: `wfhw_ptr` is valid per this function's safety contract.
444 /// Pointers from C must be valid.
450 // SAFETY: Relies on the function's contract that `chip_ptr` and `pwm_ptr` are valid
457 // SAFETY: `wfhw_ptr` is valid per this function's safety contract.
498 // `Option<extern "C" fn(...)>` or data, so a zeroed pattern (None/0) is valid initially.
518 /// Creates a reference to a [`Chip`] from a valid pointer.
522 /// The caller must ensure that `ptr` is valid and remains valid for the lifetime of the
537 // SAFETY: `self.as_raw()` provides a valid pointer for `self`'s lifetime.
543 // SAFETY: `self.as_raw()` provides a valid pointer for `self`'s lifetime.
550 // - `self.as_raw()` provides a valid pointer to `bindings::pwm_chip`.
553 // - Taking a pointer to this embedded field is valid.
562 // which we know holds our `T`. The pointer is valid for the lifetime of `self`.
604 // SAFETY: It is safe to call `pwmchip_put()` with a valid pointer obtained
609 // SAFETY: `c_chip_ptr` points to a valid chip.
612 // SAFETY: `c_chip_ptr` points to a valid chip.
614 // returned by `as_raw()` is always valid.
617 // Cast the `*mut bindings::pwm_chip` to `*mut Chip`. This is valid because
622 // SAFETY: `chip_ptr_as_self` points to a valid `Chip` (layout-compatible with
635 // SAFETY: `self.0.get()` points to a valid `pwm_chip` because `self` exists.
636 // The embedded `dev` is valid. `get_device` increments its refcount.
644 // SAFETY: `obj` is a valid pointer to a `Chip` (and thus `bindings::pwm_chip`)
678 // SAFETY: `c_chip_ptr` points to a valid chip with its ops initialized.