Sunday, October 5, 2008

This driver would receive 0 style points if I were grading it

Magic constants abound ... even when they're #defined previously. Comments like:
        /** failed after RETRY attempts **/
outputf("Failed to send after %d retries", retries);
Not just bad indentation (i.e., not what I want), but inconsistent indentation. Committing code, too, that you know to be wrong:
            /** I don't know what MII MAC only mode is!!! **/


The Linux driver, mind you, isn't much better:
/*  Update statistics.
Unlike with the EL3 we need not worry about interrupts changing
the window setting from underneath us, but we must still guard
against a race condition with a StatsUpdate interrupt updating the
table. This is done by checking that the ASM (!) code generated uses
atomic updates with '+='.
*/


By the end of this, this driver will be mostly completely rewritten. And that's fine with me.

No comments: