lkml.org 
[lkml]   [2025]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1] rust: conditionally compile dma abstraction based on CONFIG_HAS_DMA
From
On Wed, 9 Apr 2025 11:07:02 +0200
Danilo Krummrich <dakr@kernel.org> wrote:

> On Wed, Apr 09, 2025 at 02:55:01PM +0900, FUJITA Tomonori wrote:
>> Make dma abstraction conditional on CONFIG_HAS_DMA.
>
> I'm not convinced that this is the correct fix. This would require drivers to
> depend on CONFIG_HAS_DMA if they want to use the DMA API. The C side does not do
> this either.
>
> Instead, for functions like dma_alloc_attrs(), there is an empty implementation
> if CONFIG_HAS_DMA is not set [1].

Good point.

> However, this definition is not picked up by bindgen. Hence, I think the actual
> fix would be to introduce the corresponding Rust helpers.
>
> [1] https://elixir.bootlin.com/linux/v6.13.7/source/include/linux/dma-mapping.h#L189

I'll go with that approach for the next version.

Thanks,

\
 
 \ /
  Last update: 2025-04-10 15:00    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog