Re: [PATCH 1/2] rust: usb: add basic USB abstractions

From: Greg Kroah-Hartman

Date: Tue Sep 23 2025 - 10:49:27 EST


On Tue, Sep 23, 2025 at 04:42:11PM +0200, Danilo Krummrich wrote:
> On 9/23/25 4:37 PM, Greg Kroah-Hartman wrote:
> > Yes, you are right, it can be gotten that way. But I can't wait to see
> > how you wrap that C macro in rust :)
>
> We can either create a Rust helper function for it, or just re-implement it; in
> the end it boils down to just a container_of() on the parent device.

Yes, and it preserves the "const" of the pointer going into the function
call, can we do that in rust as well?