Thread (61 messages) 61 messages, 11 authors, 2022-05-13

Re: [PATCH 02/32] Introduce flexible array struct memcpy() helpers

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2022-05-05 20:15:53
Also in: keyrings, linux-arm-msm, linux-bluetooth, linux-devicetree, linux-hardening, linux-hyperv, linux-integrity, linux-rdma, linux-scsi, linux-security-module, linux-usb, linux-wireless, llvm, selinux, xen-devel

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help