From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6ADE7C433ED for ; Fri, 14 May 2021 07:01:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4634F613F6 for ; Fri, 14 May 2021 07:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230382AbhENHCy (ORCPT ); Fri, 14 May 2021 03:02:54 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:2667 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231373AbhENHCx (ORCPT ); Fri, 14 May 2021 03:02:53 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FhKC457kQzmWFS; Fri, 14 May 2021 14:59:28 +0800 (CST) Received: from localhost (10.174.179.215) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Fri, 14 May 2021 15:01:35 +0800 From: YueHaibing To: , , , , , CC: , , YueHaibing Subject: [PATCH -next] hv_utils: Fix passing zero to 'PTR_ERR' warning Date: Fri, 14 May 2021 15:01:16 +0800 Message-ID: <20210514070116.16800-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.215] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org 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 --- 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