Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: refactoring



Hi, I implemented the function pointer approach for the stv0299. I'm afraid 
I've decided not to do it, and stick with the ioctl approach. Reasons:

1) The actual switch statement code in the demodulator ioctl() functions is 
not very big. The reason the ioctl() function may appear big is because many 
of the demodulators do a lot of the processing directly in the ioctl() 
function. When moving to a function pointer approach, this code cannot just 
go away - it has to move into separate functions.

Once I'd done that for the stv0299, removed the ioctl code, and added the 
static function pointer table, there wasn't actually much of a difference. 
The C source was about the same length, and the .text+.data sections in the 
resulting module were about the same (the size of the function table ~= the 
size of the ioctl switch statement).

2) Although it does make overriding the ioctl functions nicer, we can already 
do that with the current code's ioctl_override() (although not quite as 
nicely). Using a function pointer system also has the disadvantage that is is 
harder to add in new API calls, or demodulator-specific private calls to 
support special features.

3) It is quite a lot of work to change over all the demodulators and card 
drivers. Given the above two points, I just don't think its worth it.




Home | Main Index | Thread Index