From patchwork Mon Jul 24 19:56:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 125183 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2029448vqg; Mon, 24 Jul 2023 13:14:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlGVkT2Os8wUmMgg3DdnFcOMR+V+Y3ASW7iHbsEMkEgEgM5ncXHIo/AtYoSV2twy7D9yPVxQ X-Received: by 2002:ac2:5f0b:0:b0:4fd:c923:db62 with SMTP id 11-20020ac25f0b000000b004fdc923db62mr5932783lfq.23.1690229683434; Mon, 24 Jul 2023 13:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690229683; cv=none; d=google.com; s=arc-20160816; b=nItzhEJ8n1RsTRhcC58aVph92ULawxFSvVQbQDPNrq+XiRvEY/0FxLCoVjhcXDAf5q let95i9mU3Ofekao+9glQDUIF4rLqL8JuD8KNZJrEyQtxQ1LOOrOc0rPtPwIsK71Pz7I YIiyyBjIL6QEp5rwSJ+vDw8aE8Y1e1U/cB37SPZSvaqn6rjvV31I7fOIYcgCfMevtSTd dQlRvfUxd1ZRTDzGsPcZrbvj1AApfJebfmA/9r/EpRiVsYwI4QX7CFjLJUXVkNK2YnMt k2HVRt3eahLO5vMsh5PF4PvqHo6eXNKhmY5X/L7JPpG0vgSZLCS0RTD2KAgFnEnHTr1f QZRA== 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=W4bc+fSen4d3tmDVzk4rFZkk/7Xx7nPrwBzAs5Xwr/I=; fh=6h5FY6dNz/gUFhjICxWDQlHFac4heDfVNvAhmWYdIis=; b=xcYTCddYk4ISc5cePYGnpirhGorxbfs8iyi+mSU07dEQwwybGkg2eUXA1x3sGYygj2 mlZv031FPYCO6j3yqojhqOIapPgm/ggZSHG2cU12drZf74/+XMUAhQHXCSaQkR+8Y5X3 aZALAd5EY4wthPD5VQ5Otp2Mjt0WP9MdvYsfKDOE++sl52N41CJ25s/eRFY+ENunpg9n YL36NmnV7wcGGtcESlCvLDq98ccNaoXfy5eFsUivrU93kS/8U0NILTBxlf7h8hYVyhut 2i7ntGWmYYflFISSCu9qScFPX/AXztHO0LQrsdSMNz3BH6JDYiJhN5oYfvnw+onEUO5c ZJnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AUoQC2Xv; 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 w23-20020a056402129700b0051e1c495a0csi7166037edv.376.2023.07.24.13.14.19; Mon, 24 Jul 2023 13:14:43 -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=AUoQC2Xv; 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 S230301AbjGXT5P (ORCPT + 99 others); Mon, 24 Jul 2023 15:57:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbjGXT5N (ORCPT ); Mon, 24 Jul 2023 15:57:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9B45A6; Mon, 24 Jul 2023 12:57:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8019161362; Mon, 24 Jul 2023 19:57:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05336C433C7; Mon, 24 Jul 2023 19:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690228631; bh=4/mO24Ikk4CHlDznLLlA+DvTvlfb2sd89TKv9AA3wYI=; h=From:To:Cc:Subject:Date:From; b=AUoQC2XvXKgQjD1P9rrEu/Kn5JiiXB9Y3c14lNwXwW8M78id+LM2WIXSvx/0NR4kN rpkXzhemn2iR1aPhh3j5QtMk4YkB+BZsYSHUbcUN/dhzG3tCUzR+xJBPGTVIKqqC+r ySr9TOHnyoViYDraWSOqRfjzyq3STt68AXlSa/tsZHOa4omxhxjV/EPfXYnpMeOO6+ Dcza/NTZjSvHS0tLJHix2T6ZCkHi/3NCPCv0FoCii98M8APB8a8VB+aPtzvb8gAIjv vCzrcNIkUC8Le5AjF4JTIiIwRD2+163T6KL8/D79/DqObvVQNT/3zSbc/LF+5pbFGf mASLsQvohf3pw== From: Arnd Bergmann To: Bjorn Andersson , Mathieu Poirier , Maxime Coquelin , Alexandre Torgue Cc: Arnd Bergmann , kernel test robot , Arnaud Pouliquen , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Dan Carpenter , Rob Herring , Randy Dunlap , Fabien Dessenne , Ludovic Barre , Loic Pallardy , linux-remoteproc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] remoteproc: stm32: fix incorrect optional pointers Date: Mon, 24 Jul 2023 21:56:49 +0200 Message-Id: <20230724195704.2432382-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: INBOX X-GMAIL-THRID: 1772334280402757910 X-GMAIL-MSGID: 1772334280402757910 From: Arnd Bergmann Compile-testing without CONFIG_OF shows that the of_match_ptr() macro was used incorrectly here: drivers/remoteproc/stm32_rproc.c:662:34: warning: unused variable 'stm32_rproc_match' [-Wunused-const-variable] As in almost every driver, the solution is simply to remove the use of this macro. The same thing happened with the deprecated SIMPLE_DEV_PM_OPS(), but the corresponding warning was already shut up with __maybe_unused annotations, so fix those as well by using the correct DEFINE_SIMPLE_DEV_PM_OPS() macros and removing the extraneous __maybe_unused modifiers. For completeness, also add a pm_ptr() to let the PM ops be eliminated completely when CONFIG_PM is turned off. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307242300.ia82qBTp-lkp@intel.com Fixes: 03bd158e1535e ("remoteproc: stm32: use correct format strings on 64-bit") Fixes: 410119ee29b6c ("remoteproc: stm32: wakeup the system by wdg irq") Fixes: 13140de09cc2d ("remoteproc: stm32: add an ST stm32_rproc driver") Signed-off-by: Arnd Bergmann --- drivers/remoteproc/stm32_rproc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index 98234b44f0389..9d9b13530f78a 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -921,7 +921,7 @@ static void stm32_rproc_remove(struct platform_device *pdev) rproc_free(rproc); } -static int __maybe_unused stm32_rproc_suspend(struct device *dev) +static int stm32_rproc_suspend(struct device *dev) { struct rproc *rproc = dev_get_drvdata(dev); struct stm32_rproc *ddata = rproc->priv; @@ -932,7 +932,7 @@ static int __maybe_unused stm32_rproc_suspend(struct device *dev) return 0; } -static int __maybe_unused stm32_rproc_resume(struct device *dev) +static int stm32_rproc_resume(struct device *dev) { struct rproc *rproc = dev_get_drvdata(dev); struct stm32_rproc *ddata = rproc->priv; @@ -943,16 +943,16 @@ static int __maybe_unused stm32_rproc_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops, - stm32_rproc_suspend, stm32_rproc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops, + stm32_rproc_suspend, stm32_rproc_resume); static struct platform_driver stm32_rproc_driver = { .probe = stm32_rproc_probe, .remove_new = stm32_rproc_remove, .driver = { .name = "stm32-rproc", - .pm = &stm32_rproc_pm_ops, - .of_match_table = of_match_ptr(stm32_rproc_match), + .pm = pm_ptr(&stm32_rproc_pm_ops), + .of_match_table = stm32_rproc_match, }, }; module_platform_driver(stm32_rproc_driver);