From b7056d684ccf9b04b601be490beaafc8a5d98665 Mon Sep 17 00:00:00 2001 From: Sergiy Kibrik Date: Tue, 25 Feb 2025 08:41:07 +0100 Subject: [PATCH] ioreq: allow arch_vcpu_ioreq_completion() to signal an error Return false from arch_vcpu_ioreq_completion() when completion is not handled. According to coding-best-practices.pandoc an error should be propagated to caller, if caller is expecting to handle it, which seems to the case for callers of arch_vcpu_ioreq_completion(). Suggested-by: Jan Beulich Signed-off-by: Sergiy Kibrik Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- xen/arch/x86/hvm/ioreq.c | 2 +- xen/include/xen/ioreq.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c index d6491df8e7..ec709e5f47 100644 --- a/xen/arch/x86/hvm/ioreq.c +++ b/xen/arch/x86/hvm/ioreq.c @@ -47,7 +47,7 @@ bool arch_vcpu_ioreq_completion(enum vio_completion completion) default: ASSERT_UNREACHABLE(); - break; + return false; } return true; diff --git a/xen/include/xen/ioreq.h b/xen/include/xen/ioreq.h index 4f3c6b598d..e86f0869fa 100644 --- a/xen/include/xen/ioreq.h +++ b/xen/include/xen/ioreq.h @@ -118,7 +118,7 @@ bool arch_vcpu_ioreq_completion(enum vio_completion completion); static inline bool arch_vcpu_ioreq_completion(enum vio_completion completion) { ASSERT_UNREACHABLE(); - return true; + return false; } #endif