Skip to content

Commit c6a8625

Browse files
YueHaibingliuw
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ wei: change %ld to %d ] Signed-off-by: Wei Liu <[email protected]>
1 parent bf5fd8c commit c6a8625

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hv/hv_util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,8 @@ static int hv_timesync_init(struct hv_util_service *srv)
750750
*/
751751
hv_ptp_clock = ptp_clock_register(&ptp_hyperv_info, NULL);
752752
if (IS_ERR_OR_NULL(hv_ptp_clock)) {
753-
pr_err("cannot register PTP clock: %ld\n",
754-
PTR_ERR(hv_ptp_clock));
753+
pr_err("cannot register PTP clock: %d\n",
754+
PTR_ERR_OR_ZERO(hv_ptp_clock));
755755
hv_ptp_clock = NULL;
756756
}
757757

0 commit comments

Comments
 (0)