replace uint32_t with int for diff since it can be negative. Change-Id: I06dded80159821ef6f117fe8b49e31f216033a93