Linux Media Controller development
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Rishab Madhugiri <rishab.madhugiri@gmail.com>
Cc: hansg@kernel.org, mchehab@kernel.org, gregkh@linuxfoundation.org,
	andy@kernel.org, sakari.ailus@linux.intel.com,
	linux-staging@lists.linux.dev, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: media: atomisp: Use ARRAY_SIZE macro
Date: Thu, 13 Aug 2026 10:16:56 +0300	[thread overview]
Message-ID: <an1vaFk4UrhQPkSu@stanley.mountain> (raw)
In-Reply-To: <20260813020354.152120-1-rishab.madhugiri@gmail.com>

On Thu, Aug 13, 2026 at 02:03:54AM +0000, Rishab Madhugiri wrote:
> Clean up loop bound calculation by replacing sizeof(bds_factors) /
> sizeof(struct bayer_ds_factor) with the ARRAY_SIZE() helper macro
> to improve readability and maintainability.
> 
> Signed-off-by: Rishab Madhugiri <rishab.madhugiri@gmail.com>
> ---
>  drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
> index 0ee52637e..83519dd8a 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
> @@ -2160,7 +2160,7 @@ static void __configure_video_pp_input(struct atomisp_sub_device *asd,
>  	bayer_ds_out_res->width = effective_res->width;
>  	bayer_ds_out_res->height = effective_res->height;
>  
> -	for (i = 0; i < sizeof(bds_factors) / sizeof(struct bayer_ds_factor);
> +	for (i = 0; i < ARRAY_SIZE(bds_factors);
>  	     i++) {

The i++ fits on that line now, so move it up as well.

regards,
dan carpenter

>  		if (effective_res->width >= out_width *
>  		    bds_factors[i].numerator / bds_factors[i].denominator &&
> -- 
> 2.43.0
> 

  reply	other threads:[~2026-08-13  7:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13  2:03 [PATCH] staging: media: atomisp: Use ARRAY_SIZE macro Rishab Madhugiri
2026-08-13  7:16 ` Dan Carpenter [this message]
2026-08-13  7:55   ` [PATCH v2] " Rishab Madhugiri
2026-08-13  8:15     ` Dan Carpenter
2026-08-13  9:44     ` Andy Shevchenko

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=an1vaFk4UrhQPkSu@stanley.mountain \
    --to=error27@gmail.com \
    --cc=andy@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=rishab.madhugiri@gmail.com \
    --cc=sakari.ailus@linux.intel.com \
    /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