Update spi.cpp

removed unnecessary loop