Re: [PATCH v2] staging: media: atomisp: Use ARRAY_SIZE macro
Andy Shevchenko <[email protected]>
| Newsgroups | org.kernel.vger.linux-media,dev.linux.lists.linux-staging,org.kernel.vger.linux-kernel |
|---|---|
| Organization | Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo |
| Message-ID | <[email protected]> |
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 <[email protected]> > --- ...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