diff options
author | Andre Przywara <andre.przywara@arm.com> | 2017-04-25 15:39:18 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2017-06-09 11:16:47 +0100 |
commit | cd9a8066c90f32f0888d32a6e7f80f55ae4cde5f (patch) | |
tree | 9e438d194f305d56e86024918ad93c8de3b641c3 /include | |
parent | fc189e9c6833c64d6a29e9196c689f41fca3b241 (diff) | |
download | kvmtool-cd9a8066c90f32f0888d32a6e7f80f55ae4cde5f.tar.gz |
FDT: use static phandles
The current implementation of fdt__alloc_phandle() suffers from being
implemented in a static inline function situated in a header file.
This will only create expected results within a single compilation
unit.
It seems a bit over the top to use a function to allocate phandles,
when at the end of the day a phandle is just a unique identifier.
To simplify things - especially with upcoming patches - we just
introduce an enum per architecture to hold all possible phandle sources
and use that instead of the dynamic allocation.
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/kvm/fdt.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/kvm/fdt.h b/include/kvm/fdt.h index 53d85a48..beadc7f3 100644 --- a/include/kvm/fdt.h +++ b/include/kvm/fdt.h @@ -7,6 +7,8 @@ #include <linux/types.h> +#include "kvm/fdt-arch.h" + #define FDT_MAX_SIZE 0x10000 /* Those definitions are generic FDT values for specifying IRQ @@ -33,10 +35,4 @@ enum irq_type { } \ } while (0) -static inline u32 fdt__alloc_phandle(void) -{ - static u32 phandle = 0; - return ++phandle; -} - #endif /* KVM__FDT_H */ |