spapr: Simplify spapr_qirq() handling
commitaf1861511d3853664e5362ea3d2eb14b1f8d05b4
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 23 Sep 2019 06:18:28 +0000 (23 16:18 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 4 Oct 2019 09:08:22 +0000 (4 19:08 +1000)
tree31c6ca888e775f6556900e3b996f6980789a8e14
parent9f53c0db19605f76324fb09af23d30e181a06211
spapr: Simplify spapr_qirq() handling

Currently spapr_qirq(), whic is used to find the qemu_irq for an spapr
global irq number, redirects through the SpaprIrq::qirq method.  But
the array of qemu_irqs is allocated in the PAPR layer, not the
backends, and so the method implementations all return the same thing,
just differing in the preliminary checks they make.

So, we can remove the method, and just implement spapr_qirq() directly,
including all the relevant checks in one place.  We change all those
checks into assert()s as well, since a failure here indicates an error in
the calling code.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/ppc/spapr_irq.c
include/hw/ppc/spapr_irq.h