Point taken.
Here are a few more points.
The given solution presents almost zero overhead, but has the mentioned
problem. There is a way to allocate and free minor numbers, but that requires
storage. It could be handled like the fd_set's select uses. Just a bit field.
Bit cleared == minor available, bit set == in use.
If you want to do that, you would want to know the maximum number of minors
used. Also, finding the first cleared bit in your field costs more on some
platforms, than on others.
Although I suspect this additional overhead to not matter much, since
initialising a new uart is a rare event, I have bin surprised in the past.
So:
How many minors?
Is the overhead in getting a minor acceptable?
Is it worth doing?
Cheers,
Remco
-- Remco Treffkorn (RT445) HAM DC2XT remco@rvt.com (831) 685-1201 - 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/