usb: gadget: FunctionFS: Remove VLAIS usage from gadget code
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Tue, 3 Dec 2013 14:15:30 +0000 (15:15 +0100)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:46:27 +0000 (11:46 +0900)
commitf5d6fb28f4301cee62ff62c57aa0b17563750c5b
tree8bf3f2a7662a26eb28823edc14a5632c4a235c00
parentf3e9dd4f635b7b3a910fb9b04bbaa63556a06b9b
usb: gadget: FunctionFS: Remove VLAIS usage from gadget code

The use of variable length arrays in structs (VLAIS) in the Linux Kernel code
precludes the use of compilers which don't implement VLAIS (for instance the
Clang compiler). This alternate patch calculates offsets into the kmalloc-ed
memory buffer using macros. The previous patch required multiple kmalloc and
kfree calls. This version uses "group" vs "struct" since it really is not a
struct and is essentially a group of VLA in a common allocated block. This
version also fixes the issues pointed out by Andrzej Pietrasiewicz and
Michal Nazarewicz.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
[elimination of miexed declaration and code, checkpatch cleanup]
[fixes after Michal's review]
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/f_fs.c