From patchwork Fri Jun 9 12:05:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 105584 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp899194vqr; Fri, 9 Jun 2023 05:12:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7MggZB4QPiPhBcAD/dqh6eHMJ67b+9NkB2xJMz686Q9dBt/+SMQlFoFlzr94bcgJHZjN75 X-Received: by 2002:a17:903:230d:b0:1ad:ea13:1914 with SMTP id d13-20020a170903230d00b001adea131914mr5758744plh.30.1686312756952; Fri, 09 Jun 2023 05:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686312756; cv=none; d=google.com; s=arc-20160816; b=w3qcscPZbYBHNyacoDrliaSFOFsxzAV5iqADNqTj8kw2w6xzOf6Rcg8aV24R7X+4vx fk3ea6oN8qMw0uFsBqkQQ9vIotNWmiseEKa/i2+sc/BKTOvtwYHKJJuaqhgH+JOsviFK l+VQR4FZ6k1enSxyUpaQcU5S/AzSkfKK7iZIa/l/FAQv+7eigtE/xmgSqG75oOM+zMuB 2cmRDpk05BAEWBIKFZn8oGgvzipWjaSekvGG+IIP/o7FW8osfs17evio/gZaYzfQ6VCT 58xMt/vRPWZ45oiziF3rXlQl3w66cU3nGLxAVebn81eHl1I8Bzbk1Ivwkxdv3EtkGjOU 0ayg== 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=O0dfd6QfAnYmBOe32vHgDX85wb/gvz93nPWtJ3H7KFI=; b=viEiazLbAPT6Ko+f4VTp5hvDkIl7crOQG0lA245v7+sjHGF7JD53jlQJfo6fkEI/4J e9jfu1Ty5RXMlhGy1qwc+sqxVgWSnDxU5vygTDfYeFfC8DNx2uPOCIeOF+TPv1FD5mj0 +uQ3PjIMP4daF/in9NYOfXIhe7FUKRL+w7a6CXwDOM9mio4PrQr9jDmMNjSb2HoG4JXu 6ue+Q6FGXwZ6zjlUCD1Qf//cWqCoHt7UpRinqaBXAfRDfKnYnmV8uqQDK/f6BA7f0/oZ OdOK+B+Ix4vglkSoHK4tVlB6QAl4KhYzVwBphJYkalFnL5ueMnGsWtXKvvYRq2zwkUKn 2dvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oZoQAjHb; 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 v10-20020a170902d08a00b001b3414a3346si2435614plv.441.2023.06.09.05.12.22; Fri, 09 Jun 2023 05:12:36 -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=oZoQAjHb; 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 S240018AbjFIMF4 (ORCPT + 99 others); Fri, 9 Jun 2023 08:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbjFIMFy (ORCPT ); Fri, 9 Jun 2023 08:05:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0202E185; Fri, 9 Jun 2023 05:05:54 -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 9164760C0F; Fri, 9 Jun 2023 12:05:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 126EBC433EF; Fri, 9 Jun 2023 12:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686312353; bh=0xeuT9v4fiVIQ2TWUy+BIFV+LLciMbqdOwHUGdNMBBo=; h=From:To:Cc:Subject:Date:From; b=oZoQAjHbfaE4Fz82un+OED+1HwW3L563SsDXCk/AFA9K5QBdgeypsgX+IleJE5+LL YrX2+zSmLjsS+WiBpEmT6snpaibEgIGkAk13/ab1+HtUGcCGzAuzaQ+ABRja1t3yyX zpgG2yoexAgGYK7RDRed+G1wDw68Y2rlTDMyKQGVTVas6d6VDp4wVArXwiJXxspXeE neLajz4OCht7jrXVwtSTFEfLxnBrQALiUCIElZNSutrwusfXw5M/GnyfmYd6tRP78O 44v62LbU2FbwJcgX4FfqDYyQjlu+eX5WSfGFc6oyW5kjfW7OX/D1zvxhw4Bp0DuDON MTPGuQVza6Xwg== From: Arnd Bergmann To: Bjorn Andersson , Mathieu Poirier , Maxime Coquelin , Alexandre Torgue Cc: Arnd Bergmann , Ben Levinsky , Tanmay Shah , Arnaud Pouliquen , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Dan Carpenter , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH] remoteproc: stm32: use correct format strings on 64-bit Date: Fri, 9 Jun 2023 14:05:39 +0200 Message-Id: <20230609120546.3937821-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768227085364231324?= X-GMAIL-MSGID: =?utf-8?q?1768227085364231324?= From: Arnd Bergmann With CONFIG_ARCH_STM32 making it into arch/arm64, a couple of format strings no longer work, since they rely on size_t being compatible with %x, or they print an 'int' using %z: drivers/remoteproc/stm32_rproc.c: In function 'stm32_rproc_mem_alloc': drivers/remoteproc/stm32_rproc.c:122:22: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=] drivers/remoteproc/stm32_rproc.c:122:40: note: format string is defined here 122 | dev_dbg(dev, "map memory: %pa+%x\n", &mem->dma, mem->len); | ~^ | | | unsigned int | %lx drivers/remoteproc/stm32_rproc.c:125:30: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=] drivers/remoteproc/stm32_rproc.c:125:65: note: format string is defined here 125 | dev_err(dev, "Unable to map memory region: %pa+%x\n", | ~^ | | | unsigned int | %lx drivers/remoteproc/stm32_rproc.c: In function 'stm32_rproc_get_loaded_rsc_table': drivers/remoteproc/stm32_rproc.c:646:30: error: format '%zx' expects argument of type 'size_t', but argument 4 has type 'int' [-Werror=format=] drivers/remoteproc/stm32_rproc.c:646:66: note: format string is defined here 646 | dev_err(dev, "Unable to map memory region: %pa+%zx\n", | ~~^ | | | long unsigned int | %x Fix up all three instances to work across architectures, and enable compile testing for this driver to ensure it builds everywhere. Signed-off-by: Arnd Bergmann Reviewed-by: Arnaud Pouliquen Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested --- drivers/remoteproc/Kconfig | 2 +- drivers/remoteproc/stm32_rproc.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index a850e9f486dd6..48845dc8fa852 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig @@ -313,7 +313,7 @@ config ST_SLIM_REMOTEPROC config STM32_RPROC tristate "STM32 remoteproc support" - depends on ARCH_STM32 + depends on ARCH_STM32 || COMPILE_TEST depends on REMOTEPROC select MAILBOX help diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index a7457777aae43..cf073bac79f73 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -119,10 +119,10 @@ static int stm32_rproc_mem_alloc(struct rproc *rproc, struct device *dev = rproc->dev.parent; void *va; - dev_dbg(dev, "map memory: %pa+%x\n", &mem->dma, mem->len); + dev_dbg(dev, "map memory: %pad+%zx\n", &mem->dma, mem->len); va = ioremap_wc(mem->dma, mem->len); if (IS_ERR_OR_NULL(va)) { - dev_err(dev, "Unable to map memory region: %pa+%x\n", + dev_err(dev, "Unable to map memory region: %pad+0x%zx\n", &mem->dma, mem->len); return -ENOMEM; } @@ -643,7 +643,7 @@ stm32_rproc_get_loaded_rsc_table(struct rproc *rproc, size_t *table_sz) ddata->rsc_va = devm_ioremap_wc(dev, rsc_pa, RSC_TBL_SIZE); if (IS_ERR_OR_NULL(ddata->rsc_va)) { - dev_err(dev, "Unable to map memory region: %pa+%zx\n", + dev_err(dev, "Unable to map memory region: %pa+%x\n", &rsc_pa, RSC_TBL_SIZE); ddata->rsc_va = NULL; return ERR_PTR(-ENOMEM);