winsys/amdgpu: Make use of ARRAY_SIZE macro
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>
Fri, 4 Dec 2015 04:34:33 +0000 (15:34 +1100)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 6 Dec 2015 16:09:54 +0000 (17:09 +0100)
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/winsys/amdgpu/drm/amdgpu_surface.c

index 3006bd17958e66965361fc12fba8d9edf84d37a1..4c837a8e20ff315833a141d2e230592cc27b06af 100644 (file)
@@ -145,11 +145,9 @@ ADDR_HANDLE amdgpu_addr_create(struct amdgpu_winsys *ws)
 
    regValue.backendDisables = ws->amdinfo.backend_disable[0];
    regValue.pTileConfig = ws->amdinfo.gb_tile_mode;
-   regValue.noOfEntries = sizeof(ws->amdinfo.gb_tile_mode) /
-                          sizeof(ws->amdinfo.gb_tile_mode[0]);
+   regValue.noOfEntries = ARRAY_SIZE(ws->amdinfo.gb_tile_mode);
    regValue.pMacroTileConfig = ws->amdinfo.gb_macro_tile_mode;
-   regValue.noOfMacroEntries = sizeof(ws->amdinfo.gb_macro_tile_mode) /
-                               sizeof(ws->amdinfo.gb_macro_tile_mode[0]);
+   regValue.noOfMacroEntries = ARRAY_SIZE(ws->amdinfo.gb_macro_tile_mode);
 
    createFlags.value = 0;
    createFlags.useTileIndex = 1;