[Mesa-dev] [PATCH] amd/addrlib: fix missing va_end() after va_copy()

Marek Olšák maraeo at gmail.com
Wed Sep 20 23:02:07 UTC 2017


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

M.

On Sep 20, 2017 7:48 AM, "Nicolai Hähnle" <nhaehnle at gmail.com> wrote:

> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> There's no reason to use va_copy here.
>
> CID: 1418113
> ---
> I have a slight preference for this variant.
> --
>  src/amd/addrlib/core/addrobject.cpp | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/src/amd/addrlib/core/addrobject.cpp b/src/amd/addrlib/core/
> addrobject.cpp
> index dcdb1bffc2b..452feb5fac0 100644
> --- a/src/amd/addrlib/core/addrobject.cpp
> +++ b/src/amd/addrlib/core/addrobject.cpp
> @@ -209,29 +209,25 @@ VOID Object::operator delete(
>  ************************************************************
> ****************************************
>  */
>  VOID Object::DebugPrint(
>      const CHAR* pDebugString,     ///< [in] Debug string
>      ...
>      ) const
>  {
>  #if DEBUG
>      if (m_client.callbacks.debugPrint != NULL)
>      {
> -        va_list ap;
> -
> -        va_start(ap, pDebugString);
> -
>          ADDR_DEBUGPRINT_INPUT debugPrintInput = {0};
>
>          debugPrintInput.size         = sizeof(ADDR_DEBUGPRINT_INPUT);
>          debugPrintInput.pDebugString = const_cast<CHAR*>(pDebugString);
>          debugPrintInput.hClient      = m_client.handle;
> -        va_copy(debugPrintInput.ap, ap);
> +        va_start(debugPrintInput.ap, pDebugString);
>
>          m_client.callbacks.debugPrint(&debugPrintInput);
>
> -        va_end(ap);
> +        va_end(debugPrintInput.ap);
>      }
>  #endif
>  }
>
>  } // Addr
> --
> 2.11.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170921/fac78f46/attachment.html>


More information about the mesa-dev mailing list