From 016d92266efd0ba265561c03ed140be7a2cf04cf Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Mon, 17 Apr 2023 12:05:59 -0700 Subject: [PATCH] ANDROID: gunyah: Sync with latest "gunyah: Common types and error codes for Gunyah hypercalls" Rename gh_remap_error to gh_error_remap to align with Gunyah v13 patches: https://lore.kernel.org/all/20230509204801.2824351-3-quic_eberman@quicinc.com/ Bug: 279506910 Change-Id: Id3e033108a6a42868dc12a9c20c1a06775418979 Signed-off-by: Elliot Berman --- drivers/mailbox/gunyah-msgq.c | 2 +- drivers/virt/gunyah/gunyah_vcpu.c | 7 +++---- include/linux/gunyah.h | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/mailbox/gunyah-msgq.c b/drivers/mailbox/gunyah-msgq.c index d16c523901ac..2cd05719c827 100644 --- a/drivers/mailbox/gunyah-msgq.c +++ b/drivers/mailbox/gunyah-msgq.c @@ -80,7 +80,7 @@ static int gh_msgq_send_data(struct mbox_chan *chan, void *data) * framework, then no other messages can be sent and nobody will know * to retry this message. */ - msgq->last_ret = gh_remap_error(gh_error); + msgq->last_ret = gh_error_remap(gh_error); /** * This message was successfully sent, but message queue isn't ready to diff --git a/drivers/virt/gunyah/gunyah_vcpu.c b/drivers/virt/gunyah/gunyah_vcpu.c index acb565c3a680..455ed4425121 100644 --- a/drivers/virt/gunyah/gunyah_vcpu.c +++ b/drivers/virt/gunyah/gunyah_vcpu.c @@ -192,7 +192,6 @@ static int gh_vcpu_run(struct gh_vcpu *vcpu) gh_error = gh_hypercall_vcpu_run(vcpu->rsc->capid, state_data, &vcpu_run_resp); if (gh_error == GH_ERROR_OK) { - ret = 0; switch (vcpu_run_resp.state) { case GH_VCPU_STATE_READY: if (need_resched()) @@ -238,9 +237,9 @@ static int gh_vcpu_run(struct gh_vcpu *vcpu) } } else if (gh_error == GH_ERROR_RETRY) { schedule(); - ret = 0; - } else - ret = gh_remap_error(gh_error); + } else { + ret = gh_error_remap(gh_error); + } } out: diff --git a/include/linux/gunyah.h b/include/linux/gunyah.h index ddea1ea9ce9c..2a16219fad18 100644 --- a/include/linux/gunyah.h +++ b/include/linux/gunyah.h @@ -110,10 +110,10 @@ enum gh_error { }; /** - * gh_remap_error() - Remap Gunyah hypervisor errors into a Linux error code + * gh_error_remap() - Remap Gunyah hypervisor errors into a Linux error code * @gh_error: Gunyah hypercall return value */ -static inline int gh_remap_error(enum gh_error gh_error) +static inline int gh_error_remap(enum gh_error gh_error) { switch (gh_error) { case GH_ERROR_OK: