Linux kernel staging patches
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Ahmet Sezgin Duran <ahmet@sezginduran.net>,
	gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] staging: sm750fb: use ARRAY_SIZE macro in fb_find_mode loop
Date: Sat, 23 May 2026 17:26:43 +0100	[thread overview]
Message-ID: <20260523172643.1dbcafb2@pumpkin> (raw)
In-Reply-To: <ahF8dacOkX0tdxGf@stanley.mountain>

On Sat, 23 May 2026 13:07:49 +0300
Dan Carpenter <error27@gmail.com> wrote:

> 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.

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
> 
> 


  parent reply	other threads:[~2026-05-23 16:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-23  5:15 [PATCH 0/5] staging: sm750fb: various code cleanups Ahmet Sezgin Duran
2026-05-23  5:15 ` [PATCH 1/5] staging: sm750fb: remove commented-out forward declarations Ahmet Sezgin Duran
2026-05-23  5:15 ` [PATCH 2/5] staging: sm750fb: remove unnecessary initializations Ahmet Sezgin Duran
2026-05-23  5:15 ` [PATCH 3/5] staging: sm750fb: remove unused struct fields Ahmet Sezgin Duran
2026-05-23  5:15 ` [PATCH 4/5] staging: sm750fb: use ARRAY_SIZE macro in fb_find_mode loop Ahmet Sezgin Duran
2026-05-23 10:07   ` Dan Carpenter
2026-05-23 15:06     ` Ahmet Sezgin Duran
2026-05-23 16:26     ` David Laight [this message]
2026-05-23  5:15 ` [PATCH 5/5] staging: sm750fb: deduplicate fbinfo loop in suspend/resume Ahmet Sezgin Duran
2026-05-25  8:01   ` Dan Carpenter
2026-05-25  8:23     ` Ahmet Sezgin Duran
2026-05-25 16:13       ` Dan Carpenter
2026-05-25 16:31         ` Ahmet Sezgin Duran
2026-05-25 17:59           ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260523172643.1dbcafb2@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=ahmet@sezginduran.net \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox