Re: [RFC][PATCH] input: Introduce device information ioctl

From: Henrik Rydberg
Date: Wed Dec 08 2010 - 15:37:33 EST


>

>> /*
>> + * Device types
>> + */
>> +
>> +#define DEVTYPE_KEYBOARD 0
>> +#define DEVTYPE_MOUSE 1
>> +#define DEVTYPE_JOYSTICK 2
>> +#define DEVTYPE_TOUCHPAD 3
>> +#define DEVTYPE_TABLET 4
>> +#define DEVTYPE_TOUCHSCREEN 5
>
> Add a #define DEVTYPE_UNKNOWN 0 and push everybody else down one. That way,
> an uninitialized 'struct input_devinfo' won't claim to be a keyboard.


Since types is a bitmask, the initial value will actually be unclaimed already.
To be explicit, for a keyboard, types = 1 << 0 = 1.

Thanks,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/