lkml.org 
[lkml]   [2005]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectInput: 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/

\
 
 \ /
  Last update: 2005-09-08 18:54    [W:0.026 / U:1.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site