Fix log function for potential overflow

On LP64 system, unsigned long can be 64bit
Also clean out unused static variables.

Test: flash on ARM64 device
Bug: 32181382
Change-Id: Ib91f157b7852cc98d0e4b8d914785ce5162303d8
3 files changed