{
        struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
        const u32 *regs = a6xx_protect;
-       unsigned i, count = ARRAY_SIZE(a6xx_protect), count_max = 32;
-
-       BUILD_BUG_ON(ARRAY_SIZE(a6xx_protect) > 32);
-       BUILD_BUG_ON(ARRAY_SIZE(a650_protect) > 48);
+       unsigned i, count, count_max;
 
        if (adreno_is_a650(adreno_gpu)) {
                regs = a650_protect;
                count = ARRAY_SIZE(a650_protect);
                count_max = 48;
+               BUILD_BUG_ON(ARRAY_SIZE(a650_protect) > 48);
        } else if (adreno_is_a660_family(adreno_gpu)) {
                regs = a660_protect;
                count = ARRAY_SIZE(a660_protect);
                count_max = 48;
+               BUILD_BUG_ON(ARRAY_SIZE(a660_protect) > 48);
+       } else {
+               regs = a6xx_protect;
+               count = ARRAY_SIZE(a6xx_protect);
+               count_max = 32;
+               BUILD_BUG_ON(ARRAY_SIZE(a6xx_protect) > 32);
        }
 
        /*