bitops: Header dependency fixes
cover bitops: Header dependency fixes
This series adds a missing include, kills a circular header dependency, and avoid including qemu-common.h from a header to avoid new circular dependencies.
Eduardo Habkost (3):
tests: Add missing include to test-bitops.c
bitops.h: Don't include qemu-common.h
bitmap.h: Don't include qemu-common.h
include/qemu/bitmap.h | 5 ++++- include/qemu/bitops.h | 4 +++- tests/test-bitops.c | 1 + 3 files changed, 8 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.3
PATCH 1/3 tests: Add missing include to test-bitops.c
The test code needs osdep.h for the ARRAY_SIZE macro.
--- tests/test-bitops.c | 1 + 1 file changed, 1 insertion(+)
tests/test-bitops.c +1 -0
@@ -8,6 +8,7 @@#include <glib.h> #include <stdint.h> +#include "qemu/osdep.h" #include "qemu/bitops.h" typedef struct {
Signature · 1 line
1.9.3
PATCH 2/3 bitops.h: Don't include qemu-common.h
In reply to Eduardo HabkostThis removes the following circular dependency:
bitops.h -> qemu-common.h -> target-i386/cpu.h -> target-i386/cpu-qom.h -> qom/cpu.h -> qdev-core.h -> bitmap.h -> bitops.h.
--- include/qemu/bitops.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
include/qemu/bitops.h +3 -1
@@ -12,7 +12,9 @@#ifndef BITOPS_H #define BITOPS_H -#include "qemu-common.h" +#include <stdint.h> +#include <assert.h> +#include "host-utils.h" #define BITS_PER_BYTE CHAR_BIT
Signature · 1 line
1.9.3
PATCH 3/3 bitmap.h: Don't include qemu-common.h
In reply to Eduardo HabkostThis will avoid unexpected circular header dependencies in the future.
--- include/qemu/bitmap.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/qemu/bitmap.h +4 -1
@@ -12,7 +12,10 @@#ifndef BITMAP_H #define BITMAP_H -#include "qemu-common.h" +#include <glib.h> +#include <string.h> + +#include "qemu/osdep.h" #include "qemu/bitops.h" /*
Signature · 1 line
1.9.3
Michael Tokarev
AppliedQuoted 7 lines · Eduardo Habkost
This series adds a missing include, kills a circular header dependency, and avoid including
qemu-common.hfrom a header to avoid new circular dependencies.Eduardo Habkost (3):
tests: Add missing include totest-bitops.c
bitops.h: Don't includeqemu-common.h
bitmap.h: Don't includeqemu-common.h
Applied all 3 to -trivial, _finally_ :)
Thank you!
/mjt
Quoted 10 lines · Michael Tokarev
Quoted 7 lines · Eduardo Habkost
This series adds a missing include, kills a circular header dependency, and avoid including
qemu-common.hfrom a header to avoid new circular dependencies.Eduardo Habkost (3):
tests: Add missing include totest-bitops.c
bitops.h: Don't includeqemu-common.h
bitmap.h: Don't includeqemu-common.hApplied all 3 to -trivial, _finally_ :)
Thanks!
But applying the series after commit be4d57c1ea7f17b9cadb0150b330efd9b6026972 breaks build, because now bitmap.h needs stdlib.h (for abort()). Can you squash the following into patch 3/3?
--- include/qemu/bitmap.h | 1 + 1 file changed, 1 insertion(+)
include/qemu/bitmap.h +1 -0
@@ -14,6 +14,7 @@#include <glib.h> #include <string.h> +#include <stdlib.h> #include "qemu/osdep.h" #include "qemu/bitops.h"
Signature · 1 line
1.9.3
Quoted 10 lines · Eduardo Habkost
Quoted 9 lines · Michael Tokarev
Quoted 7 lines · Eduardo Habkost
This series adds a missing include, kills a circular header dependency, and avoid including
qemu-common.hfrom a header to avoid new circular dependencies.Eduardo Habkost (3):
tests: Add missing include totest-bitops.c
bitops.h: Don't includeqemu-common.h
bitmap.h: Don't includeqemu-common.h
Quoted 7 lines
Quoted 1 line
Applied all 3 to -trivial, _finally_ :)
Thanks!
But applying the series after commit
be4d57c1ea7f17b9cadb0150b330efd9b6026972breaks build, because nowbitmap.hneedsstdlib.h(forabort()). Can you squash the following into patch 3/3?
Heh. I already fixed it in local git, -- it become obvious right when I tried to verify the whole lot, -- I usually perform build tests after applying all patches, not after each of them (actually maybe this is not good, because this way I can't catch "intermediate" breakage which breaks git bisection).
Yes, squashed it in. Thank you!
/mjt
Quoted 17 lines
--- include/qemu/bitmap.h | 1 + 1 file changed, 1 insertion(+)include/qemu/bitmap.h +1
-0@@ -14,6 +14,7 @@#include <glib.h> #include <string.h> +#include <stdlib.h> #include "qemu/osdep.h" #include "qemu/bitops.h"