On Sun Aug 16 01:01:26 2026 +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. Move loop counter
> increment to the same line as the for loop and declare the loop
> counter locally.
> 
> Signed-off-by: Rishab Madhugiri <[email protected]>
> Reviewed-by: Andy Shevchenko <[email protected]>
> Signed-off-by: Sakari Ailus <[email protected]>

Patch committed.

Thanks,
Sakari Ailus

 drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

---

diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c 
b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index 0ee52637ea30..eacd7ee5c050 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -2118,7 +2118,6 @@ static void __configure_video_pp_input(struct 
atomisp_sub_device *asd,
        static const struct bayer_ds_factor bds_factors[] = {
                {8, 1}, {6, 1}, {4, 1}, {3, 1}, {2, 1}, {3, 2}
        };
-       unsigned int i;
 
        if (width == 0 && height == 0)
                return;
@@ -2160,8 +2159,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);
-            i++) {
+       for (unsigned int i = 0; i < ARRAY_SIZE(bds_factors); i++) {
                if (effective_res->width >= out_width *
                    bds_factors[i].numerator / bds_factors[i].denominator &&
                    effective_res->height >= out_height *
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to