aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/odp_pool.c
diff options
context:
space:
mode:
authorMaxim Uvarov <maxim.uvarov@linaro.org>2018-04-16 21:50:11 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-04-17 16:39:13 +0300
commita2cad95118b79f204bc13914acf43a8fc1dd2682 (patch)
tree7e3eae17a094a8042be19212ec6964c441cf85e4 /platform/linux-generic/odp_pool.c
parenta5340c53957b3174c89d03ecf2c61e9ba98ac57c (diff)
linux-gen: fix clang on aarch64 build
No code change. Just move array definition several lines up to make clang happy to generate valid code. Fixes: https://bugs.linaro.org/show_bug.cgi?id=3611 Suggested-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/odp_pool.c')
-rw-r--r--platform/linux-generic/odp_pool.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c
index 998fc649e..955e14f9b 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -718,12 +718,13 @@ int buffer_alloc_multi(pool_t *pool, odp_buffer_hdr_t *buf_hdr[], int max_num)
buf_hdr[i] = buf_hdr_from_index(pool, cache->buf_index[j]);
}
+ /* Declare variable here to fix clang compilation bug */
+ uint32_t data[burst];
+
/* If needed, get more from the global pool */
if (odp_unlikely(num_deq)) {
- /* Temporary copy needed since odp_buffer_t is uintptr_t
- * and not uint32_t. */
- uint32_t data[burst];
-
+ /* Temporary copy to data[] needed since odp_buffer_t is
+ * uintptr_t and not uint32_t. */
ring = &pool->ring->hdr;
mask = pool->ring_mask;
burst = ring_deq_multi(ring, mask, data, burst);