cpu: Restructure code to avoid pointless ret variable indirection