cpuidle: Add a comment warning about possible overflow
[firefly-linux-kernel-4.4.55.git] / drivers / cpuidle / governors / menu.c
index a56081ce170f6610385027475ddeeb62d25c7fa6..a8b31b0ca57f3b2c8fd0225b4a7489e00d51b98a 100644 (file)
 #include <linux/math64.h>
 #include <linux/module.h>
 
+/*
+ * Please note when changing the tuning values:
+ * If (MAX_INTERESTING-1) * RESOLUTION > UINT_MAX, the result of
+ * a scaling operation multiplication may overflow on 32 bit platforms.
+ * In that case, #define RESOLUTION as ULL to get 64 bit result:
+ * #define RESOLUTION 1024ULL
+ *
+ * The default values do not overflow.
+ */
 #define BUCKETS 12
 #define INTERVALS 8
 #define RESOLUTION 1024