From 8e303b935068ca8f1a272c5be437007b21dba66b Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Sun, 18 Feb 2024 15:26:31 +0100 Subject: [PATCH] pan/genxml: Make sure pan_pack() evaluates 'dst' only once Will be useful for the cs_builder, where we have and we don't want cs_alloc_ins() to be called more than once. Signed-off-by: Boris Brezillon Reviewed-by: Antonino Maniscalco Reviewed-by: Erik Faye-Lund Part-of: --- src/panfrost/lib/genxml/gen_pack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/lib/genxml/gen_pack.py b/src/panfrost/lib/genxml/gen_pack.py index 8a3e951ac24..a90503837f7 100644 --- a/src/panfrost/lib/genxml/gen_pack.py +++ b/src/panfrost/lib/genxml/gen_pack.py @@ -120,7 +120,7 @@ __gen_unpack_padded(const uint8_t *restrict cl, uint32_t start, uint32_t end) #define pan_pack(dst, T, name) \\ for (struct PREFIX1(T) name = { PREFIX2(T, header) }, \\ - *_loop_terminate = (void *) (dst); \\ + *_loop_terminate = &name; \\ __builtin_expect(_loop_terminate != NULL, 1); \\ ({ PREFIX2(T, pack)((uint32_t *) (dst), &name); \\ _loop_terminate = NULL; }))