simplify MIPS calculation code

Signed-off-by: Steven Noonan <steven@uplinklabs.net>