Description: fix BRIGHTESS_STEP_AMOUNT calculation macro Author: Kamal Mostafa Bug-Ubuntu: https://launchpad.net/bugs/827517 The BRIGHTNESS_STEP_AMOUNT macro calculates a bogus value when called as BRIGHTNESS_STEP_AMOUNT(max - min + 1) due to missing parentheses. --- gnome-settings-daemon-3.1.4.orig/plugins/power/gsd-power-manager.c +++ gnome-settings-daemon-3.1.4/plugins/power/gsd-power-manager.c @@ -121,7 +121,7 @@ static const gchar introspection_xml[] = ""; /* on ACPI machines we have 4-16 levels, on others it's ~150 */ -#define BRIGHTNESS_STEP_AMOUNT(max) (max < 20 ? 1 : max / 20) +#define BRIGHTNESS_STEP_AMOUNT(max) ((max) < 20 ? 1 : (max) / 20) /* take a discrete value with offset and convert to percentage */ #define ABS_TO_PERCENTAGE(min, max, value) (((value - min) * 100) / (max - min))