diff options
author | Joseph Salisbury <joseph.salisbury@microsoft.com> | 2021-04-17 02:43:03 +0200 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2021-04-21 11:49:19 +0200 |
commit | 753ed9c95c37d058e50e7d42bbe296ee0bf6670d (patch) | |
tree | 8566f7edd4a24ff1f01b79bc12dd37d7dd50304c /arch/x86/hyperv/hv_init.c | |
parent | x86/hyperv: Move hv_do_rep_hypercall to asm-generic (diff) | |
download | linux-753ed9c95c37d058e50e7d42bbe296ee0bf6670d.tar.xz linux-753ed9c95c37d058e50e7d42bbe296ee0bf6670d.zip |
drivers: hv: Create a consistent pattern for checking Hyper-V hypercall status
There is not a consistent pattern for checking Hyper-V hypercall status.
Existing code uses a number of variants. The variants work, but a consistent
pattern would improve the readability of the code, and be more conformant
to what the Hyper-V TLFS says about hypercall status.
Implemented new helper functions hv_result(), hv_result_success(), and
hv_repcomp(). Changed the places where hv_do_hypercall() and related variants
are used to use the helper functions.
Signed-off-by: Joseph Salisbury <joseph.salisbury@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1618620183-9967-2-git-send-email-joseph.salisbury@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'arch/x86/hyperv/hv_init.c')
-rw-r--r-- | arch/x86/hyperv/hv_init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 7c9da3f65afa..f7dbfa51a38a 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c @@ -347,7 +347,7 @@ static void __init hv_get_partition_id(void) local_irq_save(flags); output_page = *this_cpu_ptr(hyperv_pcpu_output_arg); status = hv_do_hypercall(HVCALL_GET_PARTITION_ID, NULL, output_page); - if ((status & HV_HYPERCALL_RESULT_MASK) != HV_STATUS_SUCCESS) { + if (!hv_result_success(status)) { /* No point in proceeding if this failed */ pr_err("Failed to get partition ID: %lld\n", status); BUG(); |