[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <874izqjvmo.fsf@kernel.org>
Date: Tue, 18 Mar 2025 14:50:23 +0100
From: Andreas Hindborg <a.hindborg@...nel.org>
To: Abdiel Janulgue <abdiel.janulgue@...il.com>
Cc: rust-for-linux@...r.kernel.org, daniel.almeida@...labora.com,
dakr@...nel.org, robin.murphy@....com, aliceryhl@...gle.com, Miguel
Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, Boqun
Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, Björn Roy
Baron <bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>,
Trevor Gross <tmgross@...ch.edu>, Valentin Obst
<kernel@...entinobst.de>, linux-kernel@...r.kernel.org (open list),
Christoph Hellwig <hch@....de>, Marek Szyprowski
<m.szyprowski@...sung.com>, airlied@...hat.com, iommu@...ts.linux.dev
(open list:DMA MAPPING HELPERS)
Subject: Re: [PATCH v14 06/11] rust: dma: add dma addressing capabilities
Abdiel Janulgue <abdiel.janulgue@...il.com> writes:
> From: Danilo Krummrich <dakr@...nel.org>
>
> Implement `dma_set_mask()` and `dma_set_mask_and_coherent()` in the
> `dma::Device` trait.
>
> Those methods are used to inform the kernel about the device's DMA
> addressing capabilities.
>
> Co-developed-by: Abdiel Janulgue <abdiel.janulgue@...il.com>
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@...il.com>
> Signed-off-by: Danilo Krummrich <dakr@...nel.org>
[...]
> +
> +/// Helper function to set the bit mask for DMA addressing.
> +pub const fn dma_bit_mask(n: usize) -> u64 {
> + if n > 64 {
> + return 0;
> + }
> + if n == 64 {
> + !0
> + } else {
> + (1 << (n)) - 1
> + }
> +}
I think this is dead code?
Best regards,
Andreas Hindborg
Powered by blists - more mailing lists