Linux kernel staging patches
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Ahmet Sezgin Duran <ahmet@sezginduran.net>
Cc: 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 13:07:49 +0300	[thread overview]
Message-ID: <ahF8dacOkX0tdxGf@stanley.mountain> (raw)
In-Reply-To: <20260523051509.166152-5-ahmet@sezginduran.net>

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


  reply	other threads:[~2026-05-23 10:07 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 [this message]
2026-05-23 15:06     ` Ahmet Sezgin Duran
2026-05-23 16:26     ` David Laight
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=ahF8dacOkX0tdxGf@stanley.mountain \
    --to=error27@gmail.com \
    --cc=ahmet@sezginduran.net \
    --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