From fbaf13682147faa8fd6fa1c19e588f3ef4c5e678 Mon Sep 17 00:00:00 2001 From: James Park Date: Thu, 4 Feb 2021 12:54:20 -0800 Subject: [PATCH] radv: Pointer arithmetic without void* Fixes: 736834931bb ("radv: memset the alignment hole in cache_entry to 0") Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline_cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c index 5345083d263..7377decf439 100644 --- a/src/amd/vulkan/radv_pipeline_cache.c +++ b/src/amd/vulkan/radv_pipeline_cache.c @@ -419,9 +419,9 @@ radv_pipeline_cache_insert_shaders(struct radv_device *device, } // Make valgrind happy by filling the alignment hole at the end. - assert((void*)p == (void*)entry + size_without_align); - assert(sizeof(*entry) + ((void*)p - (void*)entry->code) == size_without_align); - memset((void*)entry + size_without_align, 0, size - size_without_align); + assert(p == (char*)entry + size_without_align); + assert(sizeof(*entry) + (p - entry->code) == size_without_align); + memset((char*)entry + size_without_align, 0, size - size_without_align); /* Always add cache items to disk. This will allow collection of * compiled shaders by third parties such as steam, even if the app