rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: rust-for-linux@vger.kernel.org, abdiel.janulgue@gmail.com,
	daniel.almeida@collabora.com, robin.murphy@arm.com,
	a.hindborg@kernel.org, ojeda@kernel.org, alex.gaynor@gmail.com,
	boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com,
	benno.lossin@proton.me, aliceryhl@google.com, tmgross@umich.edu,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] rust: helpers: Add dma_alloc_attrs() and dma_free_attrs()
Date: Mon, 14 Apr 2025 23:19:46 +0200	[thread overview]
Message-ID: <Z_178hskzPrEbDXe@cassiopeiae> (raw)
In-Reply-To: <20250412000507.157000-1-fujita.tomonori@gmail.com>

On Sat, Apr 12, 2025 at 09:05:06AM +0900, FUJITA Tomonori wrote:
> Add dma_alloc_attrs() and dma_free_attrs() helpers to fix a build
> error when CONFIG_HAS_DMA is not enabled.
> 
> Note that when CONFIG_HAS_DMA is enabled, dma_alloc_attrs() and
> dma_free_attrs() are included in both bindings_generated.rs and
> bindings_helpers_generated.rs. The former takes precedence so behavior
> remains unchanged in that case.
> 
> This fixes the following build error on UML:
> 
> error[E0425]: cannot find function `dma_alloc_attrs` in crate `bindings`
>      --> rust/kernel/dma.rs:171:23
>       |
> 171   |               bindings::dma_alloc_attrs(
>       |                         ^^^^^^^^^^^^^^^ help: a function with a similar name exists: `dma_alloc_pages`
>       |
>      ::: /home/fujita/build/um/rust/bindings/bindings_generated.rs:44568:5
>       |
> 44568 | /     pub fn dma_alloc_pages(
> 44569 | |         dev: *mut device,
> 44570 | |         size: usize,
> 44571 | |         dma_handle: *mut dma_addr_t,
> 44572 | |         dir: dma_data_direction,
> 44573 | |         gfp: gfp_t,
> 44574 | |     ) -> *mut page;
>       | |___________________- similarly named function `dma_alloc_pages` defined here
> 
> error[E0425]: cannot find function `dma_free_attrs` in crate `bindings`
>      --> rust/kernel/dma.rs:293:23
>       |
> 293   |               bindings::dma_free_attrs(
>       |                         ^^^^^^^^^^^^^^ help: a function with a similar name exists: `dma_free_pages`
>       |
>      ::: /home/fujita/build/um/rust/bindings/bindings_generated.rs:44577:5
>       |
> 44577 | /     pub fn dma_free_pages(
> 44578 | |         dev: *mut device,
> 44579 | |         size: usize,
> 44580 | |         page: *mut page,
> 44581 | |         dma_handle: dma_addr_t,
> 44582 | |         dir: dma_data_direction,
> 44583 | |     );
>       | |______- similarly named function `dma_free_pages` defined here
> 
> Fixes: ad2907b4e308 ("rust: add dma coherent allocator abstraction")
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>

Acked-by: Danilo Krummrich <dakr@kernel.org>

  reply	other threads:[~2025-04-14 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-12  0:05 [PATCH v3] rust: helpers: Add dma_alloc_attrs() and dma_free_attrs() FUJITA Tomonori
2025-04-14 21:19 ` Danilo Krummrich [this message]
2025-04-15 19:15 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_178hskzPrEbDXe@cassiopeiae \
    --to=dakr@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=abdiel.janulgue@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=daniel.almeida@collabora.com \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).