Message ID | 20221120003930.23846-1-rdunlap@infradead.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp921009wrr; Sat, 19 Nov 2022 16:41:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf7TwtOJaJ6bRF24/N4Dldey8nfZGRmDuQnuQ3Y4Jq82RqznyoyJ1K8VJJolNbEjVPKytBnK X-Received: by 2002:a17:906:6403:b0:7b2:9667:241e with SMTP id d3-20020a170906640300b007b29667241emr11028875ejm.115.1668904902726; Sat, 19 Nov 2022 16:41:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668904902; cv=none; d=google.com; s=arc-20160816; b=qE3gEOe6kuP4ByFUeqazAIx5hnmrQg6gb01bdckrPu9LATNwmt+gojrZwwXRbqWRv0 HoBGOWrgoV8h5W5blU6bdXsRixsdyfWVbHSe/vOahqLhp4e2Yvc/p7YlCZUfHLWzuVEt KzZ5wW33BlTtGU95T9sbjk5P6ZVYHumfhy+MpwXXRTWHHubOhbSgrGaRIxEunTph7chD RuYMMttSH/xCHPuOnvKR0rJ8UGkaOyGULXayqGDfxZfuOqGVoVpAtE0ttJnU98+oCY3s xbheZsVEfY+5diPRBvJwVk/BnwIzKvmxbUwqwsDRYfB3jQDfigp6L6vW7yN05bV4FLFK UnLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=h1esYPTYICzVqS5zAnG6MaCABy6Ms8LkfzyARU9oPIY=; b=efonL+rLNlIyD4y4U/XA54zzVimqjTPKTInve0V2lkDmk11jo0Ab4hCL5NBg47degz yuEV49w7dl7aX1qE2CwdP5RyXdY5897fBhEktVdhQdXmDTqtmsoCfNoC6ami1ygrSZD2 /RpMYYYrrqieuQ+Jvv7WBbZDrvixH19Tx9TqKDXOvcX2mVnpynJEh2QQjSqSr+jmgRGj lxUNSpbKeAb2WQ+zaNTL7SJJ/AZPRsUbgEOZgkl2lafe95KkHnEudowpgC2lFYRm4HSg qyArO+WbSuAyS7zkvqyZMDw9RD9ipCDHo9YaFlW7Mq3HEb58wnV22/BCHbqkDiqKmhV7 dTtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=gKLzyG3B; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg8-20020a170907970800b007aea2b23905si6423312ejc.812.2022.11.19.16.41.12; Sat, 19 Nov 2022 16:41:42 -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=@infradead.org header.s=casper.20170209 header.b=gKLzyG3B; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229454AbiKTAjp (ORCPT <rfc822;zhanghuayu.dev@gmail.com> + 99 others); Sat, 19 Nov 2022 19:39:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbiKTAjo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 19 Nov 2022 19:39:44 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F4978B31; Sat, 19 Nov 2022 16:39:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=h1esYPTYICzVqS5zAnG6MaCABy6Ms8LkfzyARU9oPIY=; b=gKLzyG3B8UGZAqDl0MeoZVyvbi tQL2LouaZiHMmUT0e3ZW1B8ZZxGUN/utMa5sk9hpERle6VBqxug5xD7PC3WaoGXEcpAx6eUUVolR7 NWWLZFcvfK4w/gcctHit4V5Ojj/7lKyea1ZJ2lO5ha67GYhhUo/8cOyIbm6BFvertlVqX8qSAhtzR 4odCN9QYFcg1MhG7vwy7CstPOuHG1KcrBdPzyYRuirWjeGH5nMzs1+VEyuvcjQM9TF+tR8K6qg636 CCOXu1cJS5eSivisuSKRPg6PLO1483+htVc/H8E8hSRlXCrE51gyhcWetuqQGmDd//Zx0hsZXshQO V6C5qoMQ==; Received: from [2601:1c2:d80:3110::a2e7] (helo=casper.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1owYN4-003hNr-95; Sun, 20 Nov 2022 00:39:42 +0000 From: Randy Dunlap <rdunlap@infradead.org> To: linux-kernel@vger.kernel.org Cc: Randy Dunlap <rdunlap@infradead.org>, Qin Jian <qinjian@cqplus1.com>, Arnd Bergmann <arnd@arndb.de>, Vincent Shih <vincent.sunplus@gmail.com>, Alessandro Zummo <a.zummo@towertech.it>, Alexandre Belloni <alexandre.belloni@bootlin.com>, linux-rtc@vger.kernel.org Subject: [PATCH] ARM: sunplus: use %pap to print resource_size_t Date: Sat, 19 Nov 2022 16:39:30 -0800 Message-Id: <20221120003930.23846-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749973627651575152?= X-GMAIL-MSGID: =?utf-8?q?1749973627651575152?= |
Series |
ARM: sunplus: use %pap to print resource_size_t
|
|
Commit Message
Randy Dunlap
Nov. 20, 2022, 12:39 a.m. UTC
Prevent a printk format warning by using %pap, which is designed for
this purpose and can handle any size of resource_size_t.
../drivers/rtc/rtc-sunplus.c: In function 'sp_rtc_probe':
../drivers/rtc/rtc-sunplus.c:243:33: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=]
243 | dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
Fixes: 0aa94eea8d95 ("ARM: sunplus: Add initial support for Sunplus SP7021 SoC")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Qin Jian <qinjian@cqplus1.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Vincent Shih <vincent.sunplus@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org
---
drivers/rtc/rtc-sunplus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Sun, Nov 20, 2022, at 01:39, Randy Dunlap wrote: > Prevent a printk format warning by using %pap, which is designed for > this purpose and can handle any size of resource_size_t. > > ../drivers/rtc/rtc-sunplus.c: In function 'sp_rtc_probe': > ../drivers/rtc/rtc-sunplus.c:243:33: warning: format '%x' expects > argument of type 'unsigned int', but argument 4 has type > 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=] > 243 | dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = > 0x%lx\n", > > Fixes: 0aa94eea8d95 ("ARM: sunplus: Add initial support for Sunplus SP7021 SoC") > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > Cc: Qin Jian <qinjian@cqplus1.com> > Cc: Arnd Bergmann <arnd@arndb.de> > Cc: Vincent Shih <vincent.sunplus@gmail.com> > Cc: Alessandro Zummo <a.zummo@towertech.it> > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> > Cc: linux-rtc@vger.kernel.org Acked-by: Arnd Bergmann <arnd@arndb.de> > 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 = 0x%pap, reg_base = 0x%lx\n", > + &sp_rtc->res->start, (unsigned long)sp_rtc->reg_base); > I would have picked %pr to print the resource, but hsi works as well. Arnd
diff -- a/drivers/rtc/rtc-sunplus.c b/drivers/rtc/rtc-sunplus.c --- a/drivers/rtc/rtc-sunplus.c +++ b/drivers/rtc/rtc-sunplus.c @@ -240,8 +240,8 @@ static int sp_rtc_probe(struct platform_ 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 = 0x%pap, reg_base = 0x%lx\n", + &sp_rtc->res->start, (unsigned long)sp_rtc->reg_base); sp_rtc->irq = platform_get_irq(plat_dev, 0); if (sp_rtc->irq < 0)