OSDN Git Service

drivers: hv: Create a consistent pattern for checking Hyper-V hypercall status
authorJoseph Salisbury <joseph.salisbury@microsoft.com>
Sat, 17 Apr 2021 00:43:03 +0000 (17:43 -0700)
committerWei Liu <wei.liu@kernel.org>
Wed, 21 Apr 2021 09:49:19 +0000 (09:49 +0000)
commit753ed9c95c37d058e50e7d42bbe296ee0bf6670d
tree8566f7edd4a24ff1f01b79bc12dd37d7dd50304c
parent6523592cee4650c6aa997d69cd0045a01e07a1ef
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>
arch/x86/hyperv/hv_apic.c
arch/x86/hyperv/hv_init.c
arch/x86/hyperv/hv_proc.c
arch/x86/hyperv/irqdomain.c
arch/x86/hyperv/mmu.c
arch/x86/hyperv/nested.c
arch/x86/include/asm/mshyperv.h
drivers/hv/hv.c
drivers/pci/controller/pci-hyperv.c
include/asm-generic/mshyperv.h