[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210514070116.16800-1-yuehaibing@huawei.com>
Date: Fri, 14 May 2021 15:01:16 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: <kys@...rosoft.com>, <haiyangz@...rosoft.com>,
<sthemmin@...rosoft.com>, <wei.liu@...nel.org>,
<decui@...rosoft.com>, <lkmlabelt@...il.com>
CC: <linux-hyperv@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH -next] hv_utils: Fix passing zero to 'PTR_ERR' warning
Sparse warn this:
drivers/hv/hv_util.c:753 hv_timesync_init() warn:
passing zero to 'PTR_ERR'
Use PTR_ERR_OR_ZERO instead of PTR_ERR to fix this.
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
drivers/hv/hv_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index e4aefeb330da..367fc6b3db3e 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -751,7 +751,7 @@ static int hv_timesync_init(struct hv_util_service *srv)
hv_ptp_clock = ptp_clock_register(&ptp_hyperv_info, NULL);
if (IS_ERR_OR_NULL(hv_ptp_clock)) {
pr_err("cannot register PTP clock: %ld\n",
- PTR_ERR(hv_ptp_clock));
+ PTR_ERR_OR_ZERO(hv_ptp_clock));
hv_ptp_clock = NULL;
}
--
2.17.1
Powered by blists - more mailing lists