Re: [PATCH v14 06/11] rust: dma: add dma addressing capabilities
From: Andreas Hindborg
Date: Tue Mar 18 2025 - 10:07:48 EST
Abdiel Janulgue <abdiel.janulgue@xxxxxxxxx> writes:
> From: Danilo Krummrich <dakr@xxxxxxxxxx>
>
> 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@xxxxxxxxx>
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@xxxxxxxxx>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
[...]
> +
> +/// 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