Cm 10.2 linaro

This fixes the build warnings when switching to gcc 4.7.  It probably fixes more warnings than we have to (these are commits from my own kernel that I'm building with 4.8 -O3 which generates more warnings), but it was faster and easier to just cherry-pick all the commits in here and to be done with it!