Re: [PATCH 4/5] staging: sm750fb: use ARRAY_SIZE macro in fb_find_mode loop

From: Dan Carpenter

Date: Sat May 23 2026 - 06:08:21 EST


On Sat, May 23, 2026 at 05:15:08AM +0000, Ahmet Sezgin Duran wrote:
> The loop in lynxfb_set_fbinfo() iterates over pdb[] and cdb[] using
> a hardcoded bound of 3.
>
> Replace it with ARRAY_SIZE(pdb) so the bound tracks the array.

I don't love this. As you mentioned, there are two arrays and they
both have 3 elements. Why prefer one over the other? This patch
makes the code look simpler than it really is. I would just leave
it as 3.

regards,
dan carpenter