spapr/xive: Rework error handling of kvmppc_xive_mmap()
commitb14adb4a27c80a255fb35451d7cb2bc70743e7f4
authorGreg Kurz <groug@kaod.org>
Mon, 10 Aug 2020 16:54:19 +0000 (10 18:54 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 13 Aug 2020 11:00:52 +0000 (13 21:00 +1000)
tree8995b87f0a8a3bf38ac7c8618899a2f47c2dd960
parent46407a2531da4ff206c1aefe8c3f6d8ad53f2de4
spapr/xive: Rework error handling of kvmppc_xive_mmap()

Callers currently check failures of kvmppc_xive_mmap() through the
@errp argument, which isn't a recommanded practice. It is preferred
to use a return value when possible.

Since NULL isn't an invalid address in theory, it seems better to
return MAP_FAILED and to teach callers to handle it.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <159707845972.1489912.719896767746375765.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/intc/spapr_xive_kvm.c