Re: [PATCH 3/8] drm/ssd13xx: Replace .page_height field in device info with a constant

From: Javier Martinez Canillas
Date: Wed Oct 11 2023 - 04:35:01 EST


Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> writes:

Hello Geert,

Thanks a lot for your feedback.

> On Mon, Oct 9, 2023 at 8:36 PM Javier Martinez Canillas
> <javierm@xxxxxxxxxx> wrote:

[...]

>> u32 array_idx = 0;

[...]

>>
>> for (k = 0; k < m; k++) {
>> - u8 byte = buf[(8 * i + k) * line_length + j / 8];
>> + u32 idx = (page_height * i + k) * line_length + j / 8;
>
> Nit: I would use unsigned int for idx, as that matches all other
> variables involved.
> But given array_idx is u32, too, u32 may makes sense.
>

Yes, this function logic is mostly based on ssd1307fb_update_rect() from
drivers/video/fbdev/ssd1307fb.c and that is from where the u32 array_idx
comes from.

As you said, I used u32 for idx to be consistent with that variable type.

>> + u8 byte = buf[idx];
>> u8 bit = (byte >> (j % 8)) & 1;
>>
>> data |= bit << k;
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
>

Thanks!

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat