According to `man 3 errno`:
```
The value of errno is never set to zero by any system
call or library function.
```
So we must set it to 0 ourselves before each `read` and `write` call to
ensure we don't get stuck in an error loop.
Almost nothing changes here except moving braces to the same line as the
function declaration. Everything else is largely whitespace changes and
a few dangling files with tab indents.
See scripts/codestyle
Ran everything through scripts/codestyle.space, which uses astyle
to generally follow K&R style.
Biggest non whitespace change is pulling brackets down on function
declarations, which I'm pretty ambivalent about, but astyle insists
on taking a stance
For both mkimage and lkboot, make sure the fpga bitfile is trimmed
(everything prior to the 8 byte sync pattern removed) and 4 byte endian
swapped prior to putting on device.