[Mesa-dev] [PATCH 4/7] gallium/winsys: Make use of ARRAY_SIZE macro

Marek Olšák maraeo at gmail.com
Fri Dec 4 03:16:48 PST 2015


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Fri, Dec 4, 2015 at 7:50 AM, Edward O'Callaghan
<eocallaghan at alterapraxis.com> wrote:
> Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
> ---
>  src/gallium/winsys/amdgpu/drm/amdgpu_surface.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
> index 3006bd1..4c837a8 100644
> --- a/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
> +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
> @@ -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;
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list