This patch is not a v2, so was anybody against using a raw pointer at some time?
Not sure why there’s ’static here. The lifetime of `cpu_addr` is the lifetime of the object.
This is why keeping a pointer and building the slice as needed is actually a better approach, IMHO.
That will correctly express the lifetime we want to enforce, i.e.:
```
pub fn cpu(&’a self) -> &’a mut [T];
```
Where ‘a is automatically filled in, of course.
+ /// # Examples
+ ///
+ /// ```
+ /// use kernel::device::Device;
+ /// use kernel::dma::CoherentAllocation;
+ ///
+ /// # fn dox(dev: &Device) -> Result<()> {
+ /// let c: CoherentAllocation<u64> = CoherentAllocation::alloc_coherent(dev, 4, GFP_KERNEL)?;
Have you considered ZSTs? What happens if someone writes down:
```
let c = CoherentAllocation<()> = …
```
This doesn’t really make sense and should be forbidden.
2.43.0
Everything else looks good to me!
— Daniel