target-arm/cpu.h: Make cpu_init("nonexistent cpu") return NULL
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 10 May 2012 12:56:09 +0000 (12:56 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 10 May 2012 12:56:09 +0000 (12:56 +0000)
commitad37ad5b25592d2829989111b8386b8007ea0d83
tree44dcb9c5689e3d21a49b8a5125df0f5d13ebccec
parent7e598de023e4f3f612be7f16acea2ec5dac010ec
target-arm/cpu.h: Make cpu_init("nonexistent cpu") return NULL

The macro definition of cpu_init meant that if cpu_arm_init()
returned NULL this wouldn't result in cpu_init() itself returning
NULL. This had the effect that "-cpu foo" for some unknown CPU
name 'foo' would cause ARM targets to segfault rather than
generating a useful error message. Fix this by making cpu_init
a simple inline function.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
target-arm/cpu.h