st/dri: replace hard-coded array size with ARRAY_SIZE()
authorEric Engestrom <eric.engestrom@imgtec.com>
Fri, 24 Nov 2017 10:49:25 +0000 (10:49 +0000)
committerEric Engestrom <eric.engestrom@imgtec.com>
Tue, 28 Nov 2017 09:50:36 +0000 (09:50 +0000)
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/state_trackers/dri/dri_screen.c

index 91f50fe8e32ae549c1df6a748b89095ba3efc274..31b2c37bfd0a9b8906b7e0624dc0f17d8c76b406 100644 (file)
@@ -219,7 +219,7 @@ dri_fill_in_modes(struct dri_screen *screen)
    if (dri_loader_get_cap(screen, DRI_LOADER_CAP_RGBA_ORDERING))
       num_formats = ARRAY_SIZE(mesa_formats);
    else
-      num_formats = 5;
+      num_formats = ARRAY_SIZE(mesa_formats) - 2;
 
    /* Add configs. */
    for (format = 0; format < num_formats; format++) {