linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] hv_utils: Fix passing zero to 'PTR_ERR' warning
@ 2021-05-14  7:01 YueHaibing
  2021-05-15 15:50 ` Wei Liu
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2021-05-14  7:01 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin, wei.liu, decui, lkmlabelt
  Cc: linux-hyperv, linux-kernel, YueHaibing

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>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] hv_utils: Fix passing zero to 'PTR_ERR' warning
  2021-05-14  7:01 [PATCH -next] hv_utils: Fix passing zero to 'PTR_ERR' warning YueHaibing
@ 2021-05-15 15:50 ` Wei Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Wei Liu @ 2021-05-15 15:50 UTC (permalink / raw)
  To: YueHaibing
  Cc: kys, haiyangz, sthemmin, wei.liu, decui, lkmlabelt, linux-hyperv,
	linux-kernel

On Fri, May 14, 2021 at 03:01:16PM +0800, YueHaibing wrote:
> 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>

Applied to hyperv-next. Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-15 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14  7:01 [PATCH -next] hv_utils: Fix passing zero to 'PTR_ERR' warning YueHaibing
2021-05-15 15:50 ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).