platform/x86: asus-wmi: Use clamp_val() instead of open coded variant
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 16 Aug 2019 11:10:03 +0000 (14:10 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 16 Aug 2019 11:20:31 +0000 (14:20 +0300)
There is no need to open code clamp_val() macro implementation.
Replace the corresponding lines with direct call to clamp_val().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/asus-wmi.c

index 6b1f661a6ce6a94b93bf7a675f976b392b43a29c..42dc2db775d129f5ac77f040366dfd138a3483c2 100644 (file)
@@ -464,12 +464,7 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
        asus = container_of(led_cdev, struct asus_wmi, kbd_led);
        max_level = asus->kbd_led.max_brightness;
 
-       if (value > max_level)
-               value = max_level;
-       else if (value < 0)
-               value = 0;
-
-       asus->kbd_led_wk = value;
+       asus->kbd_led_wk = clamp_val(value, 0, max_level);
        kbd_led_update(asus);
 }