]> git.proxmox.com Git - mirror_qemu.git/commit
hw/gpio/pl061: Clean up read/write offset handling logic
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 2 Jul 2021 10:40:10 +0000 (11:40 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 9 Jul 2021 15:09:12 +0000 (16:09 +0100)
commite24a9f6a595cc4502b67046ea3860cae2be15b71
tree56537a548c6a44fa9516895ca316aec8f328cd00
parent102d7d1fba6d1121c86ef31c33b808a3104ab263
hw/gpio/pl061: Clean up read/write offset handling logic

Currently the pl061_read() and pl061_write() functions handle offsets
using a combination of three if() statements and a switch().  Clean
this up to use just a switch, using case ranges.

This requires that instead of catching accesses to the luminary-only
registers on a stock PL061 via a check on s->rsvd_start we use
an "is this luminary?" check in the cases for each luminary-only
register.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
hw/gpio/pl061.c