diff options
| author | Miguel Ojeda <[email protected]> | 2025-08-16 20:42:15 +0000 |
|---|---|---|
| committer | Danilo Krummrich <[email protected]> | 2025-08-16 23:29:21 +0000 |
| commit | 0f580d5d3d9d9cd0953695cd32e43aac3a946338 (patch) | |
| tree | 9b439796155739b1c4e358a72949e8a77935440d /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
| parent | accel/habanalabs/gaudi2: Use kvfree() for memory allocated with kvcalloc() (diff) | |
| download | kernel-0f580d5d3d9d9cd0953695cd32e43aac3a946338.tar.gz kernel-0f580d5d3d9d9cd0953695cd32e43aac3a946338.zip | |
rust: alloc: fix `rusttest` by providing `Cmalloc::aligned_layout` too
Commit fde578c86281 ("rust: alloc: replace aligned_size() with
Kmalloc::aligned_layout()") provides a public `aligned_layout` function
in `Kamlloc`, but not in `Cmalloc`, and thus uses of it will trigger an
error in `rusttest`.
Such a user appeared in the following commit 22ab0641b939 ("rust: drm:
ensure kmalloc() compatible Layout"):
error[E0599]: no function or associated item named `aligned_layout` found for struct `alloc::allocator_test::Cmalloc` in the current scope
--> rust/kernel/drm/device.rs:100:31
|
100 | let layout = Kmalloc::aligned_layout(Layout::new::<Self>());
| ^^^^^^^^^^^^^^ function or associated item not found in `Cmalloc`
|
::: rust/kernel/alloc/allocator_test.rs:19:1
|
19 | pub struct Cmalloc;
| ------------------ function or associated item `aligned_layout` not found for this struct
Thus add an equivalent one for `Cmalloc`.
Fixes: fde578c86281 ("rust: alloc: replace aligned_size() with Kmalloc::aligned_layout()")
Signed-off-by: Miguel Ojeda <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Danilo Krummrich <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions
