Mailing List archive

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

[linux-dvb] Re: refactoring



Gerd Knorr wrote:

There is no private data any longer.

Yes, I've seen the code now. Thats is a serve design bug. The drivers
private data should not be public. And it should be allocated and freed
by the driver itself and not by someone else.

My take on this was that the demod drivers are meant to be as simple and as
small as possible. I didn't really see the point in hiding the private data
with this in mind.

Don't think of the demodulators as seperate drivers - they're not. The refactoring turns the "frontend drivers" into a library of routines used by specific card implementations. My view is that the card drivers should therefore allocate the memory needed by the library routines.

Even a sane designed library will allocate and release the data
structures itself and *not* ask the user of the library to do that.
Data structures which are private (to the driver, to library or whatever
you prefeare to call it) should be maintained by the owner and not
someone else. Not designing it this way is just insane and asking for
trouble, please don't.

nope. If the config and state structs are constant sized it is a very good thing to collect them in the card description struct and allocate one big chunk of card data instead of several small ones.

static memory rarely needs to get maintained.

Holger





Home | Main Index | Thread Index