From: Richard Henderson Date: Thu, 15 Feb 2024 06:56:52 +0000 (-1000) Subject: util/bufferiszero: Introduce biz_accel_fn typedef X-Git-Tag: v9.1.0-rc0~124^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0100ce2b49725e6ba2fbe8301855978d5d3dc790;p=thirdparty%2Fqemu.git util/bufferiszero: Introduce biz_accel_fn typedef Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- diff --git a/util/bufferiszero.c b/util/bufferiszero.c index c9a7ded0166..f9af7841bad 100644 --- a/util/bufferiszero.c +++ b/util/bufferiszero.c @@ -26,7 +26,8 @@ #include "qemu/bswap.h" #include "host/cpuinfo.h" -static bool (*buffer_is_zero_accel)(const void *, size_t); +typedef bool (*biz_accel_fn)(const void *, size_t); +static biz_accel_fn buffer_is_zero_accel; static bool buffer_is_zero_int_lt256(const void *buf, size_t len) { @@ -184,7 +185,7 @@ select_accel_cpuinfo(unsigned info) /* Array is sorted in order of algorithm preference. */ static const struct { unsigned bit; - bool (*fn)(const void *, size_t); + biz_accel_fn fn; } all[] = { #ifdef CONFIG_AVX2_OPT { CPUINFO_AVX2, buffer_zero_avx2 }, @@ -231,7 +232,7 @@ bool test_buffer_is_zero_next_accel(void) #define INIT_ACCEL buffer_is_zero_int_ge256 #endif -static bool (*buffer_is_zero_accel)(const void *, size_t) = INIT_ACCEL; +static biz_accel_fn buffer_is_zero_accel = INIT_ACCEL; bool buffer_is_zero_ool(const void *buf, size_t len) {