This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

csl_mmcsd.c: Why so huge?

 

I have been working with the CSL library for the MMC controller, and it works well.  However, the code size is huge.  Looking through csl_mmc, I notice that all the logic to send commands to the card are copy-and-pasted in each time, instead of put into some kind of function.

For most of these functions, they are only called once at initialization (if even then).  Runtime-performance in this instance has to be a secondary concern to the vast wasted RAM consumed by the repeated code.

Even if runtime performance were an issue, the repeated code could have been in an inline function or a macro.  It would be easier to read and maintain.

Was this method of software design intentional, or accidental?