fix typo in reset.sh
respect coding conventions
fix possible null pointer dereference
remove unused variable in gpio.c