mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH V1] arm64: kvm-ptp: Fix unreasonable return value judgment
@ 2021-11-19  2:36 Xin Hao
  0 siblings, 0 replies; only message in thread
From: Xin Hao @ 2021-11-19  2:36 UTC (permalink / raw)
  To: richardcochran; +Cc: xhao, netdev, linux-kernel

In kvm_arch_ptp_init() func, it calls kvm_arm_hyp_service_available()
which return value is bool type, the return value cannot be less than 0
So there fix it.

Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
---
 drivers/ptp/ptp_kvm_arm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/ptp/ptp_kvm_arm.c b/drivers/ptp/ptp_kvm_arm.c
index b7d28c8dfb84..38b06e87a192 100644
--- a/drivers/ptp/ptp_kvm_arm.c
+++ b/drivers/ptp/ptp_kvm_arm.c
@@ -13,10 +13,7 @@
 
 int kvm_arch_ptp_init(void)
 {
-	int ret;
-
-	ret = kvm_arm_hyp_service_available(ARM_SMCCC_KVM_FUNC_PTP);
-	if (ret <= 0)
+	if (!kvm_arm_hyp_service_available(ARM_SMCCC_KVM_FUNC_PTP))
 		return -EOPNOTSUPP;
 
 	return 0;
-- 
2.31.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-19  2:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19  2:36 [PATCH V1] arm64: kvm-ptp: Fix unreasonable return value judgment Xin Hao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®