[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcntHXe31H8C9GcGhc+HRA-gZjtD=uibMMYN-FS254RJw@mail.gmail.com>
Date: Fri, 6 Oct 2023 21:03:47 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Dmitry Rokosov <ddrokosov@...utedevices.com>
Cc: lee@...nel.org, pavel@....cz, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
kernel@...rdevices.ru, rockosov@...il.com,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-leds@...r.kernel.org,
George Stark <gnstark@...utedevices.com>
Subject: Re: [PATCH v1 09/11] leds: aw200xx: improve autodim calculation method
On Fri, Oct 6, 2023 at 7:05 PM Dmitry Rokosov
<ddrokosov@...utedevices.com> wrote:
>
> From: George Stark <gnstark@...utedevices.com>
>
> use DIV_ROUND_UP instead of coarse div
Please, respect English grammar and punctuation.
Refer to macros and functions as func() (note the parentheses).
...
> #define AW200XX_REG_DIM2FADE(x) ((x) + 1)
> +#define AW200XX_REG_FADE2DIM(fade) \
> + DIV_ROUND_UP((fade) * AW200XX_DIM_MAX, AW200XX_FADE_MAX)
Have you checked if the overflow is _now_ possible (compiling on
32-bit platforms as well)?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists