Skip to contentSkip to conversation

include: Two cleanups around missing 'qemu/atomic.h'

PATCH In review Philippe Mathieu-Daudé 3 participants 6 messages Dec 17, 2024 – Dec 19, 2024

lore
Share & tools
lore
#0 lore raw

cover include: Two cleanups around missing 'qemu/atomic.h'

We have 2 headers using qatomic_read() without including its declaration from "qemu/atomic.h". Include the missing header. For my own convenience I plan to merge these 2 patches via my tree.

Regards,

Phil.

Philippe Mathieu-Daudé (2):
exec/translation-block: Include missing 'qemu/atomic.h' header qemu/coroutine: Include missing 'qemu/atomic.h' header

 include/exec/translation-block.h | 1 +
 include/qemu/coroutine.h         | 1 +
 2 files changed, 2 insertions(+)
Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/2 exec/translation-block: Include missing 'qemu/atomic.h' header

When moving tb_cflags() in commit 88d4b5138a8 ("tcg: Make tb_cflags() usable from target-agnostic code") we forgot to include "qemu/atomic.h", which declares qatomic_read(). Explicitly include it now to avoid issue when refactoring unrelated headers.

---
 include/exec/translation-block.h | 1 +
 1 file changed, 1 insertion(+)
include/exec/translation-block.h +1 -0
index b99afb00779..81299b7bdb5 100644
@@ -7,6 +7,7 @@
 #ifndef EXEC_TRANSLATION_BLOCK_H
 #define EXEC_TRANSLATION_BLOCK_H
 
+#include "qemu/atomic.h"
 #include "qemu/thread.h"
 #include "exec/cpu-common.h"
 #include "exec/vaddr.h"
Signature · 1 line
2.45.2
#2 lore raw

PATCH 2/2 qemu/coroutine: Include missing 'qemu/atomic.h' header

In reply to Philippe Mathieu-Daudé

Commit 944f3d5dd21 ("coroutine: Add qemu_co_mutex_assert_locked") added an inline method which uses qatomic_read(), itself declared in "qemu/atomic.h". Explicitly include it now to avoid issue when refactoring unrelated headers.

---
 include/qemu/coroutine.h | 1 +
 1 file changed, 1 insertion(+)
include/qemu/coroutine.h +1 -0
index ff3084538b8..e545bbf620f 100644
@@ -16,6 +16,7 @@
 #define QEMU_COROUTINE_H
 
 #include "qemu/coroutine-core.h"
+#include "qemu/atomic.h"
 #include "qemu/queue.h"
 #include "qemu/timer.h"
 
Signature · 1 line
2.45.2
Acked-by on the v1 series
#4 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 9 lines · Philippe Mathieu-Daudé

We have 2 headers using qatomic_read() without including its declaration from "qemu/atomic.h". Include the missing header. For my own convenience I plan to merge these 2 patches via my tree.

Regards,

Phil.

Quoted 7 lines

Philippe Mathieu-Daudé (2):
  exec/translation-block: Include missing 'qemu/atomic.h' header qemu/coroutine: Include missing 'qemu/atomic.h' header

 include/exec/translation-block.h | 1 +
 include/qemu/coroutine.h         | 1 +

 2 files changed, 2 insertions(+)