From: Alexander Stein Date: Tue, 11 Jan 2011 09:07:09 +0000 (-0800) Subject: Input: fix force feedback capability query example X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e1336bff92c6e0f4e6212af13f11d20c29a900a2;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git Input: fix force feedback capability query example 'features' is a bit array, not byte array Signed-off-by: Alexander Stein Acked-by: Anssi Hannula Signed-off-by: Dmitry Torokhov --- 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 #include -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 )