Lines Matching full:safety
30 // SAFETY: A call to `unregister` for a given instance of `RegType` is guaranteed to be valid if
40 // SAFETY: It's safe to set the fields of `struct pci_driver` on initialization. in register()
48 // SAFETY: `pdrv` is guaranteed to be a valid `RegType`. in register()
55 // SAFETY: `pdrv` is guaranteed to be a valid `RegType`. in unregister()
65 // SAFETY: The PCI bus only ever calls the probe callback with a valid pointer to a in probe_callback()
71 // SAFETY: `DeviceId` is a `#[repr(transparent)` wrapper of `struct pci_device_id` and in probe_callback()
79 // SAFETY: By the type invariant `pdev.as_raw` returns a valid pointer to a in probe_callback()
90 // SAFETY: The PCI bus only ever calls the remove callback with a valid pointer to a in remove_callback()
94 // SAFETY: `remove_callback` is only ever called after a successful call to in remove_callback()
162 // SAFETY:
280 // SAFETY: in new()
289 // SAFETY: in new()
295 // SAFETY: in new()
305 // SAFETY: in new()
321 /// # Safety
325 // SAFETY: in do_release()
327 // `ioptr` is valid by the safety requirements. in do_release()
328 // `num` is valid by the safety requirements. in do_release()
336 // SAFETY: The safety requirements are guaranteed by the type invariant of `self.pdev`. in release()
358 // SAFETY: By the type invariant of `Self`, the MMIO range in `self.io` is properly mapped. in deref()
370 // SAFETY: `self.as_raw` is a valid pointer to a `struct pci_dev`. in vendor_id()
376 // SAFETY: `self.as_raw` is a valid pointer to a `struct pci_dev`. in device_id()
386 // SAFETY: in resource_len()
414 // SAFETY: `self.as_raw` is guaranteed to be a pointer to a valid `struct pci_dev`. in enable_device_mem()
420 // SAFETY: `self.as_raw` is guaranteed to be a pointer to a valid `struct pci_dev`. in set_master()
434 // SAFETY: `ptr` was derived from `&self`. in deref()
445 // SAFETY: Instances of `Device` are always reference-counted.
448 // SAFETY: The existence of a shared reference guarantees that the refcount is non-zero. in inc_ref()
453 // SAFETY: The safety requirements guarantee that the refcount is non-zero. in dec_ref()
460 // SAFETY: By the type invariant of `Self`, `self.as_raw()` is a pointer to a valid in as_ref()
464 // SAFETY: `dev` points to a valid `struct device`. in as_ref()
469 // SAFETY: A `Device` is always reference-counted and can be released from any thread.
472 // SAFETY: `Device` can be shared among threads because all methods of `Device`