Common code is common. Not somewhat common. This is completely wrong way of adding new chip to the library. This requires f124 common file to be added and moving the f3 specific stuff into stm32/f3/flash.h. This is what those files are for, architecture specific definitions and code.