Re: [PATCH 3/3] rust: dma: declare cfi_encoding for dma_data_direction
From: Alice Ryhl
Date: Tue Oct 20 2026 - 04:17:57 EST
On Mon, Oct 19, 2026 at 11:34:39PM +0000, Sami Tolvanen wrote:
> bindgen generates bindings::dma_data_direction as an integer by default,
> while C callback tables such as dma_buf_ops declare the parameter as
> enum dma_data_direction. kCFI encodes enum types by name even with
> integer normalization, so the type ids would not match when C calls into
> a Rust callback taking bindings::dma_data_direction.
>
> Generate dma_data_direction as a newtype with a cfi_encoding, as is done
> for lru_status, and convert DataDirection through the newtype's
> constants.
>
> Signed-off-by: Sami Tolvanen <samitolvanen@xxxxxxxxxx>
Perhaps also add:
Cc: stable@xxxxxxxxxxxxxxx
Fixes: c2437c43cfb1 ("rust: dma: implement DataDirection")
so this gets tracked alongside patches 1 and 2 for `6.18.y` backports.
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>