lkml.org 
[lkml]   [2022]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/6] asus-wmi: Implement TUF laptop keyboard RGB control
Hi Andy,

On Tue, Aug 9 2022 at 10:46:33 +0200, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Tue, Aug 9, 2022 at 4:51 AM Luke D. Jones <luke@ljones.dev> wrote:
>>
>> Adds support for TUF laptop RGB control via the multicolor LED API.
>>
>> As this is the bas for adjusting only the RGB values, it sets the
>> default mode of the keyboard to static since there is no way to read
>> any existing settings from the device. These defaults overwrite the
>> booted state of the keyboard when the module is loaded.
>
> ...
>
>> + err = asus_wmi_evaluate_method3(ASUS_WMI_METHODID_DEVS,
>> ASUS_WMI_DEVID_TUF_RGB_MODE,
>> + rgb->save | (rgb->mode << 8) | (r
>> << 16) | (g << 24),
>> + (b) | (rgb->speed << 8),
>
> Too many parentheses.

Uh, yeah. I was unable to find concrete info on this. I at one point
experienced an issue where the order of operations *without*
parentheses ended up as "x | y << (8 | z) << 16". But now I'm not even
sure if I remember that correctly. I see the order here
https://www.cs.uic.edu/~i109/Notes/COperatorPrecedenceTable.pdf

I'll do as said and test it to be certain.

>
>> + &ret);
>> + if (err)
>> + dev_err(dev, "Unable to set TUF RGB data?\n");
>> +
>> + return err;
>
> How ret is being used?

Damn.. fixed now.

>
> --
> With Best Regards,
> Andy Shevchenko


\
 
 \ /
  Last update: 2022-08-09 10:57    [W:0.107 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site