]> git.openfabrics.org - ~emulex/infiniband.git/commit
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)
committerFelipe Balbi <balbi@ti.com>
Thu, 12 Dec 2013 19:43:38 +0000 (13:43 -0600)
commite6f3862fa1ecea6579dd1727869655e88be7a5ef
tree1df971cc8d32ebf95e252e6687bd686378d03d84
parent9c2b85f4f99cb5c5f4b8e29ef15e344f93ec5be1
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