[Mesa-dev] [PATCH 04/12] amd/addrlib: mark numPipes as MAYBE_UNUSED in Addr::V1::EgBasedLib::SanityCheckMacroTiled (v2)

Marek Olšák maraeo at gmail.com
Wed Aug 22 01:12:29 UTC 2018


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

Marek
On Tue, Aug 21, 2018 at 11:25 AM Kai Wasserbäch
<kai at dev.carbon-project.org> wrote:
>
> Only used, when asserts are enabled.
>
> Fixes an unused-variable warning with GCC 8:
>  ../../../src/amd/addrlib/r800/egbaddrlib.cpp: In member function 'int Addr::V1::EgBasedLib::SanityCheckMacroTiled(ADDR_TILEINFO*) const':
>  ../../../src/amd/addrlib/r800/egbaddrlib.cpp:982:13: warning: unused variable 'numPipes' [-Wunused-variable]
>       UINT_32 numPipes    = HwlGetPipes(pTileInfo);
>               ^~~~~~~~
>
> v2: Don't realign other variable definitions, to keep in line with file
>     style (Marek)
>
> Cc: Marek Olšák <maraeo at gmail.com>
> Signed-off-by: Kai Wasserbäch <kai at dev.carbon-project.org>
> Reviewed-by: Marek Olšák <marek.olsak at amd.com>
> ---
>  src/amd/addrlib/r800/egbaddrlib.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/addrlib/r800/egbaddrlib.cpp b/src/amd/addrlib/r800/egbaddrlib.cpp
> index 3947cfda2f..905d443cfa 100644
> --- a/src/amd/addrlib/r800/egbaddrlib.cpp
> +++ b/src/amd/addrlib/r800/egbaddrlib.cpp
> @@ -33,6 +33,8 @@
>
>  #include "egbaddrlib.h"
>
> +#include "util/macros.h"
> +
>  namespace Addr
>  {
>  namespace V1
> @@ -979,7 +981,7 @@ BOOL_32 EgBasedLib::SanityCheckMacroTiled(
>      ) const
>  {
>      BOOL_32 valid       = TRUE;
> -    UINT_32 numPipes    = HwlGetPipes(pTileInfo);
> +    MAYBE_UNUSED UINT_32 numPipes = HwlGetPipes(pTileInfo);
>
>      switch (pTileInfo->banks)
>      {
> --
> 2.18.0
>


More information about the mesa-dev mailing list