Messages in this thread | | | Date | Thu, 8 Sep 2005 11:51:41 -0500 | From | Dmitry Torokhov <> | Subject | Input: seeking internal API recommendation |
| |
Hi Vojtech,
I would like to lighten input_dev structure a bit and only allocate memory for abs{val|min|max|flat|fuzz} for devices that are going to generate absolute events. It will save 1260 bytes for every input device registered.
If you remember I was also working on converting input devices to sysfs (it progresses very nicely, I will post patches soon). As part of that conversion I have a function input_allocate_device that returns new input_dev structure. To ease error handling in individual drivers I would like to have all memory allocation go into that function. Plus we might switch other parts of input_dev to dynamic allocation. So I see basically 2 possible options:
struct input_dev *input_allocate_device(int evbits); or struct input_dev *input_allocate_device(int evbit,...)
The first form will not be sufficient if we ever go past 31 event types, but I like it better than varargs.
Any suggestions? -- Dmitry - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |