mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
hidpp20-drv: no need to use doubles
We are using a uint in the end, so better have proper order in the multiplications/divisions than using doubles. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
committed by
bentiss
parent
b31c1d5ff3
commit
7e12e45311
@@ -279,7 +279,7 @@ hidpp20drv_read_led(struct ratbag_led *led)
|
||||
led->color.green = h_led->color.green;
|
||||
led->color.blue = h_led->color.blue;
|
||||
led->hz = h_led->rate;
|
||||
led->brightness = h_led->brightness * 255.0 / 100;
|
||||
led->brightness = h_led->brightness * 255 / 100;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -422,7 +422,7 @@ hidpp20drv_update_led(struct ratbag_led *led)
|
||||
h_led->color.green = led->color.green;
|
||||
h_led->color.blue = led->color.blue;
|
||||
h_led->rate = led->hz;
|
||||
h_led->brightness = led->brightness / 255.0 * 100;
|
||||
h_led->brightness = led->brightness * 100 / 255;
|
||||
|
||||
return RATBAG_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user