From: Xin Hao <xhao@linux.alibaba.com>
To: richardcochran@gmail.com
Cc: xhao@linux.alibaba.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH V1] arm64: kvm-ptp: Fix unreasonable return value judgment
Date: Fri, 19 Nov 2021 10:36:44 +0800 [thread overview]
Message-ID: <f94da8a27102a29bb178d5ca237b9e5760154238.1637289060.git.xhao@linux.alibaba.com> (raw)
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
reply other threads:[~2021-11-19 2:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f94da8a27102a29bb178d5ca237b9e5760154238.1637289060.git.xhao@linux.alibaba.com \
--to=xhao@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®