summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2021-05-14 15:01:16 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 16:53:16 +0200
commit865c6e210bd431e2594620523edda1aec4e17af3 (patch)
tree204297f50ede7b4060cc046fbe4ef37b48799167
parent8d64fd2682ae94a2f4f5628682f4f8435bdc36bd (diff)
downloadlinux-stable-865c6e210bd431e2594620523edda1aec4e17af3.tar.gz
linux-stable-865c6e210bd431e2594620523edda1aec4e17af3.tar.bz2
linux-stable-865c6e210bd431e2594620523edda1aec4e17af3.zip
hv_utils: Fix passing zero to 'PTR_ERR' warning
[ Upstream commit c6a8625fa4c6b0a97860d053271660ccedc3d1b3 ] 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@huawei.com> Link: https://lore.kernel.org/r/20210514070116.16800-1-yuehaibing@huawei.com [ wei: change %ld to %d ] Signed-off-by: Wei Liu <wei.liu@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/hv/hv_util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index e32681ee7b9f..1671f6f9ea80 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -537,8 +537,8 @@ 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));
+ pr_err("cannot register PTP clock: %d\n",
+ PTR_ERR_OR_ZERO(hv_ptp_clock));
hv_ptp_clock = NULL;
}