All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: YueHaibing <yuehaibing@huawei.com>, Wei Liu <wei.liu@kernel.org>,
	Sasha Levin <sashal@kernel.org>,
	linux-hyperv@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 04/17] hv_utils: Fix passing zero to 'PTR_ERR' warning
Date: Mon,  5 Jul 2021 11:31:00 -0400	[thread overview]
Message-ID: <20210705153114.1522046-4-sashal@kernel.org> (raw)
In-Reply-To: <20210705153114.1522046-1-sashal@kernel.org>

From: YueHaibing <yuehaibing@huawei.com>

[ 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>
---
 drivers/hv/hv_util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index 423205077bf6..2003314dcfbe 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -548,8 +548,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;
 	}
 
-- 
2.30.2


  parent reply	other threads:[~2021-07-05 15:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 15:30 [PATCH AUTOSEL 4.19 01/17] HID: do not use down_interruptible() when unbinding devices Sasha Levin
2021-07-05 15:30 ` [PATCH AUTOSEL 4.19 02/17] EDAC/ti: Add missing MODULE_DEVICE_TABLE Sasha Levin
2021-07-05 15:30 ` [PATCH AUTOSEL 4.19 03/17] ACPI: processor idle: Fix up C-state latency if not ordered Sasha Levin
2021-07-05 15:31 ` Sasha Levin [this message]
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 05/17] lib: vsprintf: Fix handling of number field widths in vsscanf Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 06/17] ACPI: EC: Make more Asus laptops use ECDT _GPE Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 07/17] block_dump: remove block_dump feature in mark_inode_dirty() Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 08/17] fs: dlm: cancel work sync othercon Sasha Levin
2021-07-05 15:31   ` [Cluster-devel] " Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 09/17] random32: Fix implicit truncation warning in prandom_seed_state() Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 10/17] fs: dlm: fix memory leak when fenced Sasha Levin
2021-07-05 15:31   ` [Cluster-devel] " Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 11/17] ACPICA: Fix memory leak caused by _CID repair function Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 12/17] ACPI: bus: Call kobject_put() in acpi_init() error path Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 13/17] platform/x86: toshiba_acpi: Fix missing error code in toshiba_acpi_setup_keyboard() Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 14/17] clocksource: Retry clock read if long delays detected Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 15/17] ACPI: tables: Add custom DSDT file as makefile prerequisite Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 16/17] HID: wacom: Correct base usage for capacitive ExpressKey status bits Sasha Levin
2021-07-05 15:31 ` [PATCH AUTOSEL 4.19 17/17] ia64: mca_drv: fix incorrect array size calculation Sasha Levin
2021-07-05 15:31   ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210705153114.1522046-4-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wei.liu@kernel.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.