Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5211079rwb; Tue, 17 Jan 2023 10:32:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXt7KaCDR4OG8Tj14BzuAiwqd7WmFjJIXwQzBYFPzH6Y8IsYRHdnbl4AgCr/dAY27/dnIAaw X-Received: by 2002:a17:906:fb0d:b0:856:6884:675f with SMTP id lz13-20020a170906fb0d00b008566884675fmr3913207ejb.52.1673980323104; Tue, 17 Jan 2023 10:32:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673980323; cv=none; d=google.com; s=arc-20160816; b=mbsNNQEqRNYqkZAA5xm3rzGSIQBaOG3zJpIzovxTTJklhVsgk3xkhyhvZ90cVCfhOq 5frPjp8IWDDONIiaW5mLPfRpMGFyrEBu52A+LnqXsLlo95W5wkEk5v0YXm8chXEaJiyw TulkdGrhd0TW4AdS/C69rXvm6XunnquPzBzv2XcSgApQX2cANghM59ITlLQ98tngjak0 zLxdXP/RjUd3outeFUyanbNjzKpkBBRdml+2FEfJ3XwGvnRtMzHjepoHLbLH2C3QsVHt L3yR3g3JnD/tXI9du3uSq8P6k9Rx/WHyXZY3cyfbhh8KxTJGHaSnyv/L8sfjXabBzuwj BuAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QBM+HgXjAFT76F06W1VN1fbTEOg+eVsRbHSiYU85qfU=; b=VuuZdnGaX6Jbti/ONmZbKSfAWVW5VbtxU7JcC8MI7fk/bnEActycCSI+ARi1OvSz3p UElDm8WkqzwgdWFKcfHVFVrq/omQuAN1jUMpPhxRqt0kjulkwLrvnH/CWl9n0lDCCMBm lOewleChg+uMycOJilWxudxBkXVmbtgKT/UvEAhBPpEkqypX3N/V8GKk8gI3m/BXaZYX iWNISXBhg0GWKaMRHbgH8d8meWWKbARIl/4yS+pXanE1rcVLs7ofR0vAO3TMaQZLqaGr nF5bSQ4rt6Oexk99h3bMzaKOZ9ePengm2qQXqhqLLvkM85WxfsyLgbkvAPHyi+FCV9gk XHsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=b5UiCiDT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp16-20020a170906c15000b00870c5d344e3si8342465ejc.139.2023.01.17.10.31.51; Tue, 17 Jan 2023 10:32:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=b5UiCiDT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjAQSTs (ORCPT + 47 others); Tue, 17 Jan 2023 13:19:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230406AbjAQSOy (ORCPT ); Tue, 17 Jan 2023 13:14:54 -0500 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6840F59E6C; Tue, 17 Jan 2023 09:55:17 -0800 (PST) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 417FE40006; Tue, 17 Jan 2023 17:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1673978115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QBM+HgXjAFT76F06W1VN1fbTEOg+eVsRbHSiYU85qfU=; b=b5UiCiDTkPXfaXibNh5BJw2ZYyy7DF3xR+Dai76oOEMRBTBckJJsiKyQnFVTen5yYXkNOR cDVXHXl+PMTKs1zwdw+sCXRAMhfVssyqoAo7pPpgtARKLWSGIlR6vwWCUbsUAurry8TFcR mCb27XZQl7sWN0aMulKqR6KfB7Lgvu1zjpOQDpmryHWiK7XnXZUtGZsMLW/eycnxnf2AMX Rx0OqkhjErr0td0fV/+PRBr7w1AJiyrVd/epGGvBn1DWuGOoen0Z4vGFIA1hvU4p0tPc6V PGluKnl6DmmY661Z+hXWnvHZVixOYDw54MjBFXxMYMz35gsPc5Y5yiEMqflEIw== Date: Tue, 17 Jan 2023 18:55:14 +0100 From: Alexandre Belloni To: Arnd Bergmann Cc: Vincent Shih , Alessandro Zummo , Arnd Bergmann , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: sunplus: fix format string for printing resource Message-ID: References: <20230117172450.2938962-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230117172450.2938962-1-arnd@kernel.org> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/01/2023 18:24:44+0100, Arnd Bergmann wrote: > 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 type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] > 243 | dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 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. > I got this one this morning, which one is more correct? :) https://lore.kernel.org/all/20230117054232.24023-1-rdunlap@infradead.org/ > 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_dev) > 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 = 0x%x, reg_base = 0x%lx\n", > - sp_rtc->res->start, (unsigned long)sp_rtc->reg_base); > + dev_dbg(&plat_dev->dev, "res = %pR, reg_base = %p\n", > + sp_rtc->res, sp_rtc->reg_base); > > sp_rtc->irq = platform_get_irq(plat_dev, 0); > if (sp_rtc->irq < 0) > -- > 2.39.0 > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com