Fix Linaro compiler warnings/error issues

Thanks Ktoonsez