From c160f17cd6f5fc3f8698b408a451149b34b1a647 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 19 Mar 2020 19:33:18 +0000 Subject: osdep.h: Drop no-longer-needed Coverity workarounds In commit a1a98357e3fd in 2018 we added some workarounds for Coverity not being able to handle the _Float* types introduced by recent glibc. Newer versions of the Coverity scan tools have support for these types, and will fail with errors about duplicate typedefs if we have our workaround. Remove our copy of the typedefs. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20200319193323.2038-2-peter.maydell@linaro.org --- include/qemu/osdep.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'include') diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 9bd3dcfd13..20f5c5f197 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -33,20 +33,6 @@ #else #include "exec/poison.h" #endif -#ifdef __COVERITY__ -/* Coverity does not like the new _Float* types that are used by - * recent glibc, and croaks on every single file that includes - * stdlib.h. These typedefs are enough to please it. - * - * Note that these fix parse errors so they cannot be placed in - * scripts/coverity-model.c. - */ -typedef float _Float32; -typedef double _Float32x; -typedef double _Float64; -typedef __float80 _Float64x; -typedef __float128 _Float128; -#endif #include "qemu/compiler.h" -- cgit v1.2.3-55-g7522 From 062c73c51e19da0703d7505f9497a70e5398cf89 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 19 Mar 2020 19:33:19 +0000 Subject: thread.h: Fix Coverity version of qemu_cond_timedwait() For Coverity's benefit, we provide simpler versions of functions like qemu_mutex_lock(), qemu_cond_wait() and qemu_cond_timedwait(). When we added qemu_cond_timedwait() in commit 3dcc9c6ec4ea, a cut and paste error meant that the Coverity version of qemu_cond_timedwait() was using the wrong _impl function, which makes the Coverity parser complain: "/qemu/include/qemu/thread.h", line 159: warning #140: too many arguments in function call return qemu_cond_timedwait(cond, mutex, ms); ^ "/qemu/include/qemu/thread.h", line 159: warning #120: return value type does not match the function type return qemu_cond_timedwait(cond, mutex, ms); ^ "/qemu/include/qemu/thread.h", line 156: warning #1563: function "qemu_cond_timedwait" not emitted, consider modeling it or review parse diagnostics to improve fidelity static inline bool (qemu_cond_timedwait)(QemuCond *cond, QemuMutex *mutex, ^ These aren't fatal, but reduce the scope of the analysis. Fix the error. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20200319193323.2038-3-peter.maydell@linaro.org --- include/qemu/thread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/qemu/thread.h b/include/qemu/thread.h index 047db0307e..10262c63f5 100644 --- a/include/qemu/thread.h +++ b/include/qemu/thread.h @@ -67,7 +67,7 @@ extern QemuCondTimedWaitFunc qemu_cond_timedwait_func; #define qemu_cond_wait(c, m) \ qemu_cond_wait_impl(c, m, __FILE__, __LINE__); #define qemu_cond_timedwait(c, m, ms) \ - qemu_cond_wait_impl(c, m, ms, __FILE__, __LINE__); + qemu_cond_timedwait_impl(c, m, ms, __FILE__, __LINE__); #else #define qemu_mutex_lock(m) ({ \ QemuMutexLockFunc _f = atomic_read(&qemu_mutex_lock_func); \ -- cgit v1.2.3-55-g7522 From 2e7980244585a5be6f2c1b4e14c19d7932ee2fcb Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 19 Mar 2020 19:33:20 +0000 Subject: thread.h: Remove trailing semicolons from Coverity qemu_mutex_lock() etc All the Coverity-specific definitions of qemu_mutex_lock() and friends have a trailing semicolon. This works fine almost everywhere because of QEMU's mandatory-braces coding style and because most callsites are simple, but target/s390x/sigp.c has a use of qemu_mutex_trylock() as an if() statement, which makes the ';' a syntax error: "../target/s390x/sigp.c", line 461: warning #18: expected a ")" if (qemu_mutex_trylock(&qemu_sigp_mutex)) { ^ Remove the bogus semicolons from the macro definitions. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20200319193323.2038-4-peter.maydell@linaro.org --- include/qemu/thread.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/qemu/thread.h b/include/qemu/thread.h index 10262c63f5..d22848138e 100644 --- a/include/qemu/thread.h +++ b/include/qemu/thread.h @@ -57,17 +57,17 @@ extern QemuCondTimedWaitFunc qemu_cond_timedwait_func; * hide them. */ #define qemu_mutex_lock(m) \ - qemu_mutex_lock_impl(m, __FILE__, __LINE__); + qemu_mutex_lock_impl(m, __FILE__, __LINE__) #define qemu_mutex_trylock(m) \ - qemu_mutex_trylock_impl(m, __FILE__, __LINE__); + qemu_mutex_trylock_impl(m, __FILE__, __LINE__) #define qemu_rec_mutex_lock(m) \ - qemu_rec_mutex_lock_impl(m, __FILE__, __LINE__); + qemu_rec_mutex_lock_impl(m, __FILE__, __LINE__) #define qemu_rec_mutex_trylock(m) \ - qemu_rec_mutex_trylock_impl(m, __FILE__, __LINE__); + qemu_rec_mutex_trylock_impl(m, __FILE__, __LINE__) #define qemu_cond_wait(c, m) \ - qemu_cond_wait_impl(c, m, __FILE__, __LINE__); + qemu_cond_wait_impl(c, m, __FILE__, __LINE__) #define qemu_cond_timedwait(c, m, ms) \ - qemu_cond_timedwait_impl(c, m, ms, __FILE__, __LINE__); + qemu_cond_timedwait_impl(c, m, ms, __FILE__, __LINE__) #else #define qemu_mutex_lock(m) ({ \ QemuMutexLockFunc _f = atomic_read(&qemu_mutex_lock_func); \ -- cgit v1.2.3-55-g7522