Thread (14 messages) 14 messages, 3 authors, 2026-05-25

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

From: David Laight <hidden>
Date: 2026-05-23 16:26:46
Also in: linux-staging, lkml

On Sat, 23 May 2026 13:07:49 +0300
Dan Carpenter [off-list ref] wrote:
On Sat, May 23, 2026 at 05:15:08AM +0000, Ahmet Sezgin Duran wrote:
quoted
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.
Or change the code to have one array of a struct that contains the ptr:count
pair and iterate over that.
Both pdb[] and cdb[] (or what replaces them) should (probably) be static.

This interface is strange, the NULL:0 requests the modes from xfree86
(which aren't visible) whereas the vesa modes that are defined just
after them have to be requested by ptr:count,

-- David

regards,
dan carpenter
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help