summaryrefslogtreecommitdiffstats
path: root/Documentation/input
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@informatik.tu-chemnitz.de>2011-01-11 01:07:09 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-01-11 01:07:55 -0800
commite1336bff92c6e0f4e6212af13f11d20c29a900a2 (patch)
tree38b32eb929a00791986c1fafdb0d71e094c0a692 /Documentation/input
parent5fca6cac9feed75efc0b2c454305a5f538d887f5 (diff)
downloadlinux-e1336bff92c6e0f4e6212af13f11d20c29a900a2.tar.bz2
Input: fix force feedback capability query example
'features' is a bit array, not byte array Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> Acked-by: Anssi Hannula <anssi.hannula@iki.fi> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'Documentation/input')
-rw-r--r--Documentation/input/ff.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/Documentation/input/ff.txt b/Documentation/input/ff.txt
index ded4d5f53109..b3867bf49f8f 100644
--- a/Documentation/input/ff.txt
+++ b/Documentation/input/ff.txt
@@ -49,7 +49,9 @@ This information is subject to change.
#include <linux/input.h>
#include <sys/ioctl.h>
-unsigned long features[1 + FF_MAX/sizeof(unsigned long)];
+#define BITS_TO_LONGS(x) \
+ (((x) + 8 * sizeof (unsigned long) - 1) / (8 * sizeof (unsigned long)))
+unsigned long features[BITS_TO_LONGS(FF_CNT)];
int ioctl(int file_descriptor, int request, unsigned long *features);
"request" must be EVIOCGBIT(EV_FF, size of features array in bytes )