Skip to content

Commit 616bcea

Browse files
ChristianKoenigAMDbbrezillon
authored andcommitted
drm/exec: use unique instead of local label
GCC forbids to jump to labels in loop conditions and a new clang check stumbled over this. So instead using a local label inside the loop condition use an unique label outside of it. Fixes: 0959321 ("drm: execution context for GEM buffers v7") Link: https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html Link: ClangBuiltLinux#1890 Link: llvm/llvm-project@2021910 Reported-by: Nathan Chancellor <nathan@kernel.org> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> CC: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Christian König <christian.koenig@amd.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230731123625.3766-1-christian.koenig@amd.com
1 parent 2040420 commit 616bcea

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

include/drm/drm_exec.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#ifndef __DRM_EXEC_H__
44
#define __DRM_EXEC_H__
55

6+
#include <linux/compiler.h>
67
#include <linux/ww_mutex.h>
78

89
#define DRM_EXEC_INTERRUPTIBLE_WAIT BIT(0)
@@ -74,13 +75,12 @@ struct drm_exec {
7475
* Since labels can't be defined local to the loops body we use a jump pointer
7576
* to make sure that the retry is only used from within the loops body.
7677
*/
77-
#define drm_exec_until_all_locked(exec) \
78-
for (void *__drm_exec_retry_ptr; ({ \
79-
__label__ __drm_exec_retry; \
80-
__drm_exec_retry: \
81-
__drm_exec_retry_ptr = &&__drm_exec_retry; \
82-
(void)__drm_exec_retry_ptr; \
83-
drm_exec_cleanup(exec); \
78+
#define drm_exec_until_all_locked(exec) \
79+
__PASTE(__drm_exec_, __LINE__): \
80+
for (void *__drm_exec_retry_ptr; ({ \
81+
__drm_exec_retry_ptr = &&__PASTE(__drm_exec_, __LINE__);\
82+
(void)__drm_exec_retry_ptr; \
83+
drm_exec_cleanup(exec); \
8484
});)
8585

8686
/**

0 commit comments

Comments
 (0)