OSDN Git Service

spapr: Clean up RTAS set-indicator
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 6 Jun 2017 07:05:53 +0000 (17:05 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 8 Jun 2017 04:38:26 +0000 (14:38 +1000)
commit7b7258f810d2bd40e2fb99c469c5db318d6c3d92
tree229e5bb5c345c0d62b2a0b0a44a19a8e338d0ebc
parent454b580ae9ae3e7722f1cd5f6da7bb479f86bbd8
spapr: Clean up RTAS set-indicator

In theory the RTAS set-indicator call can be used for a number of
"indicators" defined by PAPR.  In practice the only ones we're ever likely
to implement are those used for Dynamic Reconfiguration (i.e. hotplug).
Because of this, the current implementation determines the associated DRC
object, before dispatching based on the type of indicator.

However, this means we also need a check that we're dealing with a DR
related indicator at all, which duplicates some of the logic from the
switch further down.

Even though it means a bit of code duplication, things work out cleaner if
we delegate the DRC lookup to the individual indicator type functions -
and it also allows some further cleanups.

While we're there, remove references to "sensor", a copy/paste artefact
from the related, but distinct "get-sensor" call.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ppc/spapr_drc.c
hw/ppc/trace-events