]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: f_fs: refactor and document __ffs_ep0_read_events better
authorMichal Nazarewicz <mina86@mina86.com>
Wed, 10 Sep 2014 15:50:24 +0000 (17:50 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Jan 2015 18:13:29 +0000 (12:13 -0600)
commitb7ea8c742d19a1f23926de3416525346f24eaa62
treef863583ae64c446e9381438534b6a11f8f6f4d8d
parent0aa14052273a3ad4efb827aed6325da7857ec78c
usb: gadget: f_fs: refactor and document __ffs_ep0_read_events better

Instead of using variable length array, use a static length equal to
the size of the ffs->ev.types array.  This gets rid of a sparse warning:

drivers/usb/gadget/function/f_fs.c:401:44: warning:
Variable length array is used.

and makes it more explicit that the array has a very tight upper size
limit.  Also add some more documentation about the ev.types array and
how its size is limited and affects the rest of the code.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Rohith Seelaboyina <rseelaboyina@nvidia.com>
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_fs.c