lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_NDpx8HOgZKx2qx=fh-j-MYtcZifBR5LFMVWvzwhENKqw@mail.gmail.com>
Date:   Mon, 20 Sep 2021 11:38:23 -0400
From:   Alex Deucher <alexdeucher@...il.com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Harry Wentland <harry.wentland@....com>,
        Leo Li <sunpeng.li@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>, Zhan Liu <zhan.liu@....com>,
        Ashley Thomas <Ashley.Thomas2@....com>,
        Anson Jacob <Anson.Jacob@....com>,
        Arnd Bergmann <arnd@...db.de>, Jun Lei <Jun.Lei@....com>,
        Wesley Chalmers <Wesley.Chalmers@....com>,
        Lee Jones <lee.jones@...aro.org>,
        Meenakshikumar Somasundaram <meenakshikumar.somasundaram@....com>,
        Wyatt Wood <wyatt.wood@....com>, Jude Shih <shenshih@....com>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/amd/display: fix empty debug macros

On Mon, Sep 20, 2021 at 8:16 AM Arnd Bergmann <arnd@...nel.org> wrote:
>
> From: Arnd Bergmann <arnd@...db.de>
>
> Using an empty macro expansion as a conditional expression
> produces a W=1 warning:
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c: In function 'dce_aux_transfer_with_retries':
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:775:156: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
>   775 |                                                                 "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_DEFER");
>       |                                                                                                                                                            ^
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:783:155: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
>   783 |                                                                 "dce_aux_transfer_with_retries: AUX_RET_SUCCESS: AUX_TRANSACTION_REPLY_I2C_OVER_AUX_NACK");
>       |                                                                                                                                                           ^
>
> Expand it to "do { } while (0)" instead to make the expression
> more robust and avoid the warning.
>
> Fixes: 56aca2309301 ("drm/amd/display: Add AUX I2C tracing.")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> index e14f99b4b0c3..3c3347341103 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c
> @@ -42,7 +42,7 @@
>  #define DC_LOGGER \
>         engine->ctx->logger
>
> -#define DC_TRACE_LEVEL_MESSAGE(...) /* do nothing */
> +#define DC_TRACE_LEVEL_MESSAGE(...) do { } while (0)
>  #define IS_DC_I2CAUX_LOGGING_ENABLED() (false)
>  #define LOG_FLAG_Error_I2cAux LOG_ERROR
>  #define LOG_FLAG_I2cAux_DceAux LOG_I2C_AUX
> @@ -76,7 +76,7 @@ enum {
>  #define DEFAULT_AUX_ENGINE_MULT   0
>  #define DEFAULT_AUX_ENGINE_LENGTH 69
>
> -#define DC_TRACE_LEVEL_MESSAGE(...) /* do nothing */
> +#define DC_TRACE_LEVEL_MESSAGE(...) do { } while (0)
>
>  static void release_engine(
>         struct dce_aux *engine)
> --
> 2.29.2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ