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)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 15 May 2014 05:26:46 +0000 (07:26 +0200)
commit741f152e1e7df2241326432445d944ab9199c1b2
tree0c6f18152ad5bd10591e3e856c334b8efdf12821
parent3d9db767d13674802a0fde3add1537fa554fcbda
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