[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-rdma
Subject:    Re: [PATCH 02/32] Introduce flexible array struct memcpy() helpers
From:       Johannes Berg <johannes () sipsolutions ! net>
Date:       2022-05-05 20:12:53
Message-ID: e1ea4926f105b456f6a86ce30a0380ee5f48fe6d.camel () sipsolutions ! net
[Download RAW message or body]

On Thu, 2022-05-05 at 13:08 -0700, Keith Packard wrote:


> I bet you've already considered the simpler form:
> 
>         struct something *instance = mem_to_flex_dup(byte_array, count, GFP_KERNEL);
>         if (IS_ERR(instance))
>             return PTR_ERR(instance);
> 

Sadly, this doesn't work in any way because mem_to_flex_dup() needs to
know at least the type, hence passing 'instance', which is simpler than
passing 'struct something'.

johannes
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic