Mailing List archive

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

[linux-dvb] Re: refactoring



Gerd Knorr wrote:
> 
> Andrew's approach might be easier to understand on a first sight.  Look
> again, it's not.  You have one struct with both config info and state
> info mixed in there.  It's not clear who has to setup stuff:  It is the
> dvb adapter driver or is it the frontend driver?  Same for releasing the
> stuff.
> 
> I have both separated.  That makes it possible to have static allocated,
> read/only config data structs.  And it's also pretty clear who has to
> maintain what:  The dvb adapter driver's job is to care about the config
> data, and it is the frontend drivers job to maintain its own state info.
> It is next to impossible to get it wrong.  And that is a big advantage
> in code maintainability.

I fully second that. From a maintainability pov this mixture
of private and public data is problematic. With the rate at which
new card variants appear on the market we should make it as
easy as possible for newbies to hack the drivers. This goal
seems to be more important to me than to save a few lines of code
or a kmalloc/kfree here and there.

Johannes




Home | Main Index | Thread Index