linux/drivers/input
Javier Martinez Canillas a841178445 mfd: cros_ec: Use a zero-length array for command data
Commit 1b84f2a4cd ("mfd: cros_ec: Use fixed size arrays to transfer
data with the EC") modified the struct cros_ec_command fields to not
use pointers for the input and output buffers and use fixed length
arrays instead.

This change was made because the cros_ec ioctl API uses that struct
cros_ec_command to allow user-space to send commands to the EC and
to get data from the EC. So using pointers made the API not 64-bit
safe. Unfortunately this approach was not flexible enough for all
the use-cases since there may be a need to send larger commands
on newer versions of the EC command protocol.

So to avoid to choose a constant length that it may be too big for
most commands and thus wasting memory and CPU cycles on copy from
and to user-space or having a size that is too small for some big
commands, use a zero-length array that is both 64-bit safe and
flexible. The same buffer is used for both output and input data
so the maximum of these values should be used to allocate it.

Suggested-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-15 13:18:19 +01:00
..
gameport Input: initialize device counter variables with -1 2014-12-03 15:27:17 -08:00
joystick Input: xpad - add rumble support for Xbox One controller 2015-04-14 17:01:53 -07:00
keyboard mfd: cros_ec: Use a zero-length array for command data 2015-06-15 13:18:19 +01:00
misc Input: mma8450 - convert to using managed resources 2015-03-24 11:35:06 -07:00
mouse Merge branch 'next' into for-linus 2015-04-21 11:12:42 -07:00
serio Input: gscps2 - drop pci_ids dependency 2015-04-06 09:38:08 -07:00
tablet Input: gtco - use sign_extend32() for sign extension 2015-01-26 23:07:45 -08:00
touchscreen Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2015-04-21 12:54:08 -07:00
apm-power.c
evbug.c
evdev.c Input: evdev - do not queue SYN_DROPPED if queue is empty 2015-02-05 19:29:02 -08:00
ff-core.c Input: ff-core - use new debug macros 2015-04-14 14:29:49 -07:00
ff-memless.c [media] fixp-arith: replace sin/cos table by a better precision one 2015-03-02 14:50:06 -03:00
input-compat.c
input-compat.h
input-mt.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2015-04-14 18:25:15 -07:00
input-polldev.c Input: implement managed polled input devices 2014-05-14 16:40:04 -07:00
input.c Input: do not try to filter out events if handler is not a filter 2015-01-08 13:53:34 -08:00
joydev.c
Kconfig Input: mousedev - allow disabling even without CONFIG_EXPERT 2013-10-31 08:46:07 -07:00
Makefile
matrix-keymap.c
mousedev.c Input: mousedev - fix race when creating mixed device 2014-03-29 14:44:23 -07:00
sparse-keymap.c treewide: Fix typo in Documentation/DocBook 2014-02-19 14:58:17 +01:00