]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qemu-thread: Replace __linux__ with CONFIG_LINUX
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Mon, 26 May 2025 05:29:14 +0000 (14:29 +0900)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 6 Jun 2025 12:32:55 +0000 (14:32 +0200)
scripts/checkpatch.pl warns for __linux__ saying "architecture specific
defines should be avoided".

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/r/20250526-event-v4-4-5b784cc8e1de@daynix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/qemu/thread-posix.h
util/qemu-thread-posix.c

index 5f2f3d1386bcec6b4cc3bcc799509011155c3538..c412623a9143a7cef04c4f573b3efc7e92e38c1a 100644 (file)
@@ -33,7 +33,7 @@ struct QemuSemaphore {
 };
 
 struct QemuEvent {
-#ifndef __linux__
+#ifndef CONFIG_LINUX
     pthread_mutex_t lock;
     pthread_cond_t cond;
 #endif
index f80f564e762c3e142075891d3938437f5a71b397..3dc4d30052ed8649f97b927805b71846e09e07f1 100644 (file)
@@ -317,7 +317,7 @@ void qemu_sem_wait(QemuSemaphore *sem)
     qemu_mutex_unlock(&sem->mutex);
 }
 
-#ifdef __linux__
+#ifdef CONFIG_LINUX
 #include "qemu/futex.h"
 #else
 static inline void qemu_futex_wake(QemuEvent *ev, int n)
@@ -363,7 +363,7 @@ static inline void qemu_futex_wait(QemuEvent *ev, unsigned val)
 
 void qemu_event_init(QemuEvent *ev, bool init)
 {
-#ifndef __linux__
+#ifndef CONFIG_LINUX
     pthread_mutex_init(&ev->lock, NULL);
     pthread_cond_init(&ev->cond, NULL);
 #endif
@@ -376,7 +376,7 @@ void qemu_event_destroy(QemuEvent *ev)
 {
     assert(ev->initialized);
     ev->initialized = false;
-#ifndef __linux__
+#ifndef CONFIG_LINUX
     pthread_mutex_destroy(&ev->lock);
     pthread_cond_destroy(&ev->cond);
 #endif