OSDN Git Service

hw/arm/virt: Use VIRT_GIC_VERSION_* enum values in create_gic()
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 8 Apr 2022 14:15:48 +0000 (15:15 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 22 Apr 2022 13:44:53 +0000 (14:44 +0100)
commit5a389a9aec382c5093c6c143a5a6ed7809eadc12
tree1bee02b20594ba39689a3d5897ad52fdf30a8c25
parent445d5825dab3253f2d04d7e9749a06930f4a84d1
hw/arm/virt: Use VIRT_GIC_VERSION_* enum values in create_gic()

Everywhere we need to check which GIC version we're using, we look at
vms->gic_version and use the VIRT_GIC_VERSION_* enum values, except
in create_gic(), which copies vms->gic_version into a local 'int'
variable and makes direct comparisons against values 2 and 3.

For consistency, change this function to check the GIC version
the same way we do elsewhere. This includes not implicitly relying
on the enumeration type values happening to match the integer
'revision' values the GIC device object wants.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220408141550.1271295-40-peter.maydell@linaro.org
hw/arm/virt.c