lkml.org 
[lkml]   [2017]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] dell-laptop: Fix keyboard led max_brightness property for Dell Latitude E6410
On Wed, Oct 18, 2017 at 9:06 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
> This machine reports number of keyboard backlight led levels, instead of
> value of the last led level index. Therefore max_brightness properly needs
> to be subtracted by 1 to match led max_brightness API.
>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> Reported-by: Gabriel M. Elder <gabriel@tekgnowsys.com>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=196913

> + u8 kbd_led_num_of_levels_instead_of_last_index;

Sorry for last minute review comments.

First of all, can it be just boolean?

Naming... Yes, too hard as always was, is and will be.

What about just

kbd_led_use_levels?

Also, does it make sense to create a quirks as an unsigned long and
put there corresponding bits with definitions?

/* Comment what is this for */
#define QUIRK_KBD_LED_USE_LEVELS 0

unsigned long quirks;

?

> + if (quirks && quirks->kbd_led_num_of_levels_instead_of_last_index && info->levels)
> + info->levels--;

With last suggestion if becomes something like

if (quirks & BIT(QUIRK_KBD_LED_USE_LEVELS) && info->levels)


--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2017-10-22 17:17    [W:0.140 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site