Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp264426pxj; Fri, 14 May 2021 02:55:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpPHk0uGjZRpr/zbPNTp3LEtW+2KqH1o5oJFylOw635vjIkUp8PEBAnfIvHLJcgTGeRnfV X-Received: by 2002:a05:6638:32a8:: with SMTP id f40mr42229898jav.84.1620986111411; Fri, 14 May 2021 02:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620986111; cv=none; d=google.com; s=arc-20160816; b=v2A8ldbKvbl83HXutjgSbWDcOzR851MpAmGwLAB9A+JhvfJp/MaqBBB3LehUjuMkco 7Yz8kCt5yH3hCUHnZsxfSWPHGSWgCeCb2UWLJJk2Xsz+RdX+ZnaF9m/KBQFCF98n4nyr TKxkngt8/BOWrnq3LyaYMfUw7gp9nUQWa+wcEshe/j41Hjqs3ehJTD+JCKWUgM/zVylJ Zost4FUiUFhsA0ghGYC9Rn4wn2ZvzRuKoCBZXKLrR6BmR/4SL/Tgnxu82k4knrAaprY8 iu8LEHpI13arhbq7Jo5wXAYD0yESao4EGF+3OLSkL45lXQ1PkOrW20dc/JdRLVql/EZB VYvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=QWSdqaX+MWIBbiga1fkE4uTEtLUrUzVSgth2ijxqQCI=; b=DsTa8e7QN17cBhLElhVaBNbCHg24rw2zIrhyDe4c8bNnjOc/Rca/osnLE9z7rpyA19 QujAAEdAqKqmRfEBW5UG2hgLh1hTnwUUKsDcs8vo9rU3zBaExuwONNsd1afrQApQ/sV5 FqzPjOpdWHMnCf+OT6XqVTg5xZ1J7A2F0Ggwxa5y9OeIQhXZb9BbO80PGMx9tJNFgHAW Mx1nA3AzcYgC1ROsl5Mxqbfy1UmM7Ra1zycE+YLul6AQLdDMxzVaRl0M93/bUk6fqTad k5TOs1laGbeSn77Su+l4P7x97hvmE9/ta1P57Z7/mBAXCu39fgBgss7+lgaRbuWfZgSM AkYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w14si8017154ilu.141.2021.05.14.02.54.59; Fri, 14 May 2021 02:55:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231728AbhENHCy (ORCPT + 99 others); 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-kernel@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