Move duplicated code to print l2 cache config into the common code.