summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-05-04 22:12:20 +0200
committerRobert Foss <robert.foss@collabora.com>2017-05-04 16:23:55 -0400
commit31029d550c17946822ff6f4b45a7cceac0149a50 (patch)
treeb69bef98834f538f64798c89095d70798fe3fc0d
parent76093a4b8220069f369290d38a2da80ee1d86e81 (diff)
downloadandroid-device-linaro-generic-31029d550c17946822ff6f4b45a7cceac0149a50.tar.gz
android-device-linaro-generic-31029d550c17946822ff6f4b45a7cceac0149a50.tar.xz
lights: normalize with max
Otherwise when we get 255 brightness and 100 max_brightness, we will really end up with 99 normalized: 255 * 100 / 256 = 99
-rw-r--r--lights/lights.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lights/lights.c b/lights/lights.c
index 1e77b78..1191c0e 100644
--- a/lights/lights.c
+++ b/lights/lights.c
@@ -95,7 +95,7 @@ static int normalize_brightness(int brightness, int max_brightness)
* to the max_brightness range given
*/
ret = brightness * max_brightness;
- ret = ret / 256;
+ ret = ret / 255;
return ret;
}