aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dim.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dim.h')
-rw-r--r--include/linux/dim.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/dim.h b/include/linux/dim.h
index 9fa4b3f88c39..ad5f219ce2ff 100644
--- a/include/linux/dim.h
+++ b/include/linux/dim.h
@@ -17,7 +17,7 @@
* We consider 10% difference as significant.
*/
#define IS_SIGNIFICANT_DIFF(val, ref) \
- (((100UL * abs((val) - (ref))) / (ref)) > 10)
+ ((ref) && (((100UL * abs((val) - (ref))) / (ref)) > 10))
/**
* Calculate the gap between two values.
@@ -233,8 +233,9 @@ void dim_park_tired(struct dim *dim);
*
* Calculate the delta between two samples (in data rates).
* Takes into consideration counter wrap-around.
+ * Returned boolean indicates whether curr_stats are reliable.
*/
-void dim_calc_stats(struct dim_sample *start, struct dim_sample *end,
+bool dim_calc_stats(struct dim_sample *start, struct dim_sample *end,
struct dim_stats *curr_stats);
/**