]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/xe: Use ARRAY_SIZE in guc_waklv_init()
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 12 Sep 2025 22:05:34 +0000 (15:05 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 15 Sep 2025 14:50:53 +0000 (07:50 -0700)
Prefer using ARRAY_SIZE where needed and just passing 1 instead of
calculating the size of one element.

Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202508130158.eogeBZQT-lkp@intel.com/
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://lore.kernel.org/r/20250912-guc-ads-array-size-v1-1-a6555392a1f8@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_guc_ads.c

index 5631722f34f53fd718f690e074b4f211f1fb5635..58e0b0294a5bcfbd5a3c9cf24ecb9bcd947f1b14 100644 (file)
@@ -339,7 +339,7 @@ static void guc_waklv_init(struct xe_guc_ads *ads)
        if (XE_GT_WA(gt, 13011645652)) {
                u32 data = 0xC40;
 
-               guc_waklv_enable(ads, &data, sizeof(data) / sizeof(u32), &offset, &remain,
+               guc_waklv_enable(ads, &data, 1, &offset, &remain,
                                 GUC_WA_KLV_NP_RD_WRITE_TO_CLEAR_RCSM_AT_CGP_LATE_RESTORE);
        }
 
@@ -355,7 +355,7 @@ static void guc_waklv_init(struct xe_guc_ads *ads)
                        0x0,
                        0xF,
                };
-               guc_waklv_enable(ads, data, sizeof(data) / sizeof(u32), &offset, &remain,
+               guc_waklv_enable(ads, data, ARRAY_SIZE(data), &offset, &remain,
                                 GUC_WA_KLV_RESTORE_UNSAVED_MEDIA_CONTROL_REG);
        }