Re: [PATCH v2] staging: media: atomisp: Use ARRAY_SIZE macro
From: Andy Shevchenko
Date: Thu Aug 13 2026 - 06:02:19 EST
On Thu, Aug 13, 2026 at 07:55:29AM +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.
> v2: Move loop increment to the same line as the for statement as requested.
This should go...
> Signed-off-by: Rishab Madhugiri <rishab.madhugiri@xxxxxxxxx>
> ---
...under here, so it won't be included into Git history.
...
> - for (i = 0; i < sizeof(bds_factors) / sizeof(struct bayer_ds_factor);
> - i++) {
> + for (i = 0; i < ARRAY_SIZE(bds_factors); i++) {
While at it, also consider
for (unsigned int i = 0; i < ARRAY_SIZE(bds_factors); i++) {
and dropping the above definition since i is not used outside of the loop.
--
With Best Regards,
Andy Shevchenko