lkml.org 
[lkml]   [2023]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/8] drm/ssd13xx: Replace .page_height field in device info with a constant
Date
Geert Uytterhoeven <geert@linux-m68k.org> writes:

Hello Geert,

Thanks a lot for your feedback.

> On Mon, Oct 9, 2023 at 8:36 PM Javier Martinez Canillas
> <javierm@redhat.com> 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@glider.be>
>

Thanks!

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat

\
 
 \ /
  Last update: 2023-10-11 10:35    [W:0.103 / U:1.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site