From nobody Sun Sep 14 22:28:32 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63F03C54E76 for ; Tue, 17 Jan 2023 17:26:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232620AbjAQR0P (ORCPT ); Tue, 17 Jan 2023 12:26:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230147AbjAQRZe (ORCPT ); Tue, 17 Jan 2023 12:25:34 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32B6046706; Tue, 17 Jan 2023 09:24:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C5BD6B8166E; Tue, 17 Jan 2023 17:24:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1BF1C433F0; Tue, 17 Jan 2023 17:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673976294; bh=KC6Cqdox5PMT4Fg/LqX4+EbIIxzPEvcJfLC8UsQ29qQ=; h=From:To:Cc:Subject:Date:From; b=nnCHEsqnLTKVK0s2IzoHZ1KqwB/vrMDGIYRPqOp+liW2QDONQWlvWr7QX3K1dT5q6 JDLAGl9sAdNNM/nx2X+CAdLuhTyc35r5uUsFhfqtkDgcv+S6s3PXM0nNZ6zCyfVxCF TLTF+tyJqxZKNTPtQfWghB7rjmurg/g/CreZUkRa62PFT7tA5Uk3rpr2iwSA5QwxoM tohtfWoqcio12ZeOGfb0bu6nJNtuxutut0mPGtuTjuo5VnPwkWj1pdd3vA1Ox2ELnJ m41soeFDoZZ2hEzbgZw828LjtVXb7dMpY8351sBJKKyszX3OYtXijswjE5sn55Wcl8 AGWhH3lcUYvBA== From: Arnd Bergmann To: Vincent Shih , Alessandro Zummo , Alexandre Belloni Cc: Arnd Bergmann , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rtc: sunplus: fix format string for printing resource Date: Tue, 17 Jan 2023 18:24:44 +0100 Message-Id: <20230117172450.2938962-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann On 32-bit architectures with 64-bit resource_size_t, sp_rtc_probe() causes a compiler warning: drivers/rtc/rtc-sunplus.c: In function 'sp_rtc_probe': drivers/rtc/rtc-sunplus.c:243:33: error: format '%x' expects argument of ty= pe 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long lon= g unsigned int'} [-Werror=3Dformat=3D] 243 | dev_dbg(&plat_dev->dev, "res =3D 0x%x, reg_base =3D 0x%lx\n= ", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The best way to print a resource is the special %pR format string, and similarly to print a pointer we can use %p and avoid the cast. Fixes: fad6cbe9b2b4 ("rtc: Add driver for RTC in Sunplus SP7021") Signed-off-by: Arnd Bergmann --- drivers/rtc/rtc-sunplus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-sunplus.c b/drivers/rtc/rtc-sunplus.c index e8e2ab1103fc..4b578e4d44f6 100644 --- a/drivers/rtc/rtc-sunplus.c +++ b/drivers/rtc/rtc-sunplus.c @@ -240,8 +240,8 @@ static int sp_rtc_probe(struct platform_device *plat_de= v) if (IS_ERR(sp_rtc->reg_base)) return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base), "%s devm_ioremap_resource fail\n", RTC_REG_NAME); - dev_dbg(&plat_dev->dev, "res =3D 0x%x, reg_base =3D 0x%lx\n", - sp_rtc->res->start, (unsigned long)sp_rtc->reg_base); + dev_dbg(&plat_dev->dev, "res =3D %pR, reg_base =3D %p\n", + sp_rtc->res, sp_rtc->reg_base); =20 sp_rtc->irq =3D platform_get_irq(plat_dev, 0); if (sp_rtc->irq < 0) --=20 2.39.0