Skip to content

Commit

Permalink
Input: fix force feedback capability query example
Browse files Browse the repository at this point in the history
'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>
  • Loading branch information
Alexander Stein authored and Dmitry Torokhov committed Jan 11, 2011
1 parent 5fca6ca commit e1336bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Documentation/input/ff.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit e1336bf

Please sign in to comment.