From: Rob Clark Date: Tue, 31 Mar 2020 15:31:00 +0000 (-0700) Subject: freedreno/log: fix build error X-Git-Tag: upstream/20.1.8~1838 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59754409cc6e9c9e8f9f82a4a523e7370c373a07;p=platform%2Fupstream%2Fmesa.git freedreno/log: fix build error It seems some versions of gcc are less clever about const initializers: ``` ../src/gallium/drivers/freedreno/freedreno_log.c:58:33: error: initializer element is not constant const unsigned msgs_per_chunk = bo_size / sizeof(uint64_t); ^~~~~~~ ``` See https://gitlab.freedesktop.org/mesa/mesa/-/issues/2713 Signed-off-by: Rob Clark Tested-by: Marge Bot Part-of: --- diff --git a/src/gallium/drivers/freedreno/freedreno_log.c b/src/gallium/drivers/freedreno/freedreno_log.c index c1fe4da..8eb1966 100644 --- a/src/gallium/drivers/freedreno/freedreno_log.c +++ b/src/gallium/drivers/freedreno/freedreno_log.c @@ -54,8 +54,10 @@ * for profiling at that level. */ -const unsigned bo_size = 0x1000; -const unsigned msgs_per_chunk = bo_size / sizeof(uint64_t); +enum { + bo_size = 0x1000, + msgs_per_chunk = bo_size / sizeof(uint64_t), +}; struct fd_log_chunk { struct list_head node;