]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: fix empty debug macros
authorArnd Bergmann <arnd@arndb.de>
Mon, 20 Sep 2021 12:16:00 +0000 (14:16 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 23 Sep 2021 19:58:21 +0000 (15:58 -0400)
commit2dd6a9f2444e4d5adbc9c575525e604143089c13
treece03114bf62c4661cc4bdaa46e267d9e39534ad1
parentfa5d4460cfe6a4ab811a36d49fe44ccb61944b70
drm/amd/display: fix empty debug macros

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: 535bb80ae10b ("drm/amd/display: Add AUX I2C tracing.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c