Messages in this thread |  | | Date | Thu, 10 Apr 2025 21:59:26 +0900 (JST) | | Subject | Re: [PATCH v1] rust: conditionally compile dma abstraction based on CONFIG_HAS_DMA | | From | FUJITA Tomonori <> |
| |
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,
|  |