Message ID | 20230517201951.619693-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp36162vqo; Wed, 17 May 2023 13:32:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5r6iOUVJvv2zL/ISK/SSlt6U/nYe7+9LgAkuzmhyOtZCQEFYgd43qQbw0IRAhCYXt8Qh5u X-Received: by 2002:a17:90a:7563:b0:253:38ff:be4b with SMTP id q90-20020a17090a756300b0025338ffbe4bmr57555pjk.47.1684355531935; Wed, 17 May 2023 13:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684355531; cv=none; d=google.com; s=arc-20160816; b=uYpgj5GM7f9zs20z0FurrTUHWxAitvGRzFMf9cxr4bj60AHMgf0WrYtDM2goP6UnRK 4jAQgPXSrbrcBLRY4N1ySrIh9p8OOAHxMnhTM242qoKlRjdfjzBGbZsRHiwdTjEvBEwM 2RvLSxxOkbUVYT9KPn3PR+tIba54aNcmCSpvBylBMLFR0XslshRk+GPKLkWwLC1v+gH5 agaJ0bviTga693LhZOs73N/FNB7VS+wU+1HlZ+P7/ymZH0b5T3mBN/xXpxMPQsuCEftF 0qwdHUwO5Gdoej9hW0dvjsAXS1VpjdfcSYaoO+qUsyY/hu/HSBO6RpimrmkphHXYQWT6 aKzw== 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=w5pQcmhXuvHXZZp+HLxQwp+cpWDmYdUV4HoDyVV9JNQ=; b=NDBhskp2LH6frzcI6vmTf6QxpBhB0ok6m39k9gaNtMZ/OF7JwO6q7MRde6bnk99QbA 9LBz6EUymqjio1+Nx5ln/xT/+oU3iPm0MI3Zu7JHhrAkdr4xGiZgOaxUkm62B1kG2Xpj uBHCfewv7y/CD7rm21l2zPI566VJWOgZTIhkvvwc6f+p6RYToinRilrIUjLu/n1u91Ao SVb0ia5qiX3Z+Aa5p9x8B2DUwCN8Qi9hPg/Hu/59EWrm5fdZnYmS0thxIqyuoZX5o/1r +myjZZ0Dg048KZBMU5LzJX2iDZL5UlwHq537ErIcXSOFSAKMKw6IaaUasQOutQCQLj3f 0tsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dKTVy9RV; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a17090acb0a00b002496cedea8esi2519937pjt.24.2023.05.17.13.31.59; Wed, 17 May 2023 13:32:11 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=dKTVy9RV; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229647AbjEQUT7 (ORCPT <rfc822;abdi.embedded@gmail.com> + 99 others); Wed, 17 May 2023 16:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjEQUT6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 17 May 2023 16:19:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58B681FE5; Wed, 17 May 2023 13:19:57 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id E8E02636B3; Wed, 17 May 2023 20:19:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9214EC433EF; Wed, 17 May 2023 20:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684354796; bh=h3i1Kbtu2+A1CAmny+IHIGNGTx6Ino27EpoDhBCMCUg=; h=From:To:Cc:Subject:Date:From; b=dKTVy9RVKLUOGSJm4GI2wiXXavIxvJWRQOXFML1qF5dX6IQv/j/BQ6OaaGy1EZqrF QjDxyEbxGDQMGJU6/anHP0DmQ1SbRsrsqNQd+pDZ/H+Na1pefAzI2HHDI5F+wEXZgx 1HOHkb86GpqWY1YuS/jZ/Q1TACdvCNg/xWDInApnYvb875r1BuhPrO41mIt5fh1nEI akTM8FKO4g1jA4i1ku59nOLBOhiEh3Jcdy9CH0ndt1QvULB22Ks2YcRN6t0KAFbhbm 9LbEfcVyimFeGNWIdT9yHa1J4HlFev9CcniTZC+iStMbCy37giqWRUAR8saClYm0zk DptvrOxjgrWLg== From: Arnd Bergmann <arnd@kernel.org> To: Linus Walleij <linus.walleij@linaro.org>, Vinod Koul <vkoul@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de>, Julia Lawall <Julia.Lawall@inria.fr>, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dmaengine: ste_dma40: use proper format string for resource_size_t Date: Wed, 17 May 2023 22:19:47 +0200 Message-Id: <20230517201951.619693-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1766174786306527830?= X-GMAIL-MSGID: =?utf-8?q?1766174786306527830?= |
Series |
dmaengine: ste_dma40: use proper format string for resource_size_t
|
|
Commit Message
Arnd Bergmann
May 17, 2023, 8:19 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> When LPAE is set, both the dma_addr_t and resource_size_t become 64 bit wide, causing a warning about the format string: drivers/dma/ste_dma40.c: In function 'd40_probe': drivers/dma/ste_dma40.c:3539:23: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] 3539 | dev_info(dev, "found LCPA SRAM at 0x%08x, size 0x%08x\n", Change both to the special %pap and %pap helpers for these types. Fixes: 5a1a3b9c19dd ("dmaengine: ste_dma40: Get LCPA SRAM from SRAM node") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/dma/ste_dma40.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 17-05-23, 22:19, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > When LPAE is set, both the dma_addr_t and resource_size_t become 64 bit > wide, causing a warning about the format string: > > drivers/dma/ste_dma40.c: In function 'd40_probe': > drivers/dma/ste_dma40.c:3539:23: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] > 3539 | dev_info(dev, "found LCPA SRAM at 0x%08x, size 0x%08x\n", > > Change both to the special %pap and %pap helpers for these types. Already posted [1] and applied now [1]: https://lore.kernel.org/r/20230517064434.141091-1-vkoul@kernel.org
On Thu, May 18, 2023, at 13:29, Vinod Koul wrote: > On 17-05-23, 22:19, Arnd Bergmann wrote: >> From: Arnd Bergmann <arnd@arndb.de> >> >> When LPAE is set, both the dma_addr_t and resource_size_t become 64 bit >> wide, causing a warning about the format string: >> >> drivers/dma/ste_dma40.c: In function 'd40_probe': >> drivers/dma/ste_dma40.c:3539:23: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] >> 3539 | dev_info(dev, "found LCPA SRAM at 0x%08x, size 0x%08x\n", >> >> Change both to the special %pap and %pap helpers for these types. > > Already posted [1] and applied now > > [1]: https://lore.kernel.org/r/20230517064434.141091-1-vkoul@kernel.org I think yours is wrong: you use %pR with a resource_size_t, but it expects a "struct resource instead". Arnd
On 18-05-23, 13:59, Arnd Bergmann wrote: > On Thu, May 18, 2023, at 13:29, Vinod Koul wrote: > > On 17-05-23, 22:19, Arnd Bergmann wrote: > >> From: Arnd Bergmann <arnd@arndb.de> > >> > >> When LPAE is set, both the dma_addr_t and resource_size_t become 64 bit > >> wide, causing a warning about the format string: > >> > >> drivers/dma/ste_dma40.c: In function 'd40_probe': > >> drivers/dma/ste_dma40.c:3539:23: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] > >> 3539 | dev_info(dev, "found LCPA SRAM at 0x%08x, size 0x%08x\n", > >> > >> Change both to the special %pap and %pap helpers for these types. > > > > Already posted [1] and applied now > > > > [1]: https://lore.kernel.org/r/20230517064434.141091-1-vkoul@kernel.org > > I think yours is wrong: you use %pR with a resource_size_t, but it > expects a "struct resource instead". Right, i indeed looked up wrong format
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 9ff6dd9e2fa2..dbc988cfc4bf 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3536,8 +3536,8 @@ static int __init d40_probe(struct platform_device *pdev) } base->lcpa_size = resource_size(&res_lcpa); base->phy_lcpa = res_lcpa.start; - dev_info(dev, "found LCPA SRAM at 0x%08x, size 0x%08x\n", - (u32)base->phy_lcpa, base->lcpa_size); + dev_info(dev, "found LCPA SRAM at %pad, size %pa\n", + &base->phy_lcpa, &base->lcpa_size); /* We make use of ESRAM memory for this. */ val = readl(base->virtbase + D40_DREG_LCPA);