msm: kgsl: Reimplement the timestamp comparison function
Make timestamp_cmp return -1, 0 or 1 depending if
the first operand is less than, equal or greater
than the second operand.
Change-Id: Ic0dedbad0ea2d918e0eeef9428859f0b54a6e7ad
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
diff --git a/drivers/gpu/msm/kgsl.h b/drivers/gpu/msm/kgsl.h
index b5c24f0..3bb722d 100644
--- a/drivers/gpu/msm/kgsl.h
+++ b/drivers/gpu/msm/kgsl.h
@@ -184,10 +184,14 @@
return 0;
}
-static inline bool timestamp_cmp(unsigned int new, unsigned int old)
+static inline int timestamp_cmp(unsigned int new, unsigned int old)
{
int ts_diff = new - old;
- return (ts_diff >= 0) || (ts_diff < -20000);
+
+ if (ts_diff == 0)
+ return 0;
+
+ return ((ts_diff > 0) || (ts_diff < -20000)) ? 1 : -1;
}
static inline void