Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4936407rdb; Tue, 12 Dec 2023 13:47:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGr9HXzPTFiemPCzOYG6NYO2+k6M1Rq4JWWcOEqKsEBAlyFVWecnO09S75AhVu1A/LkUj4l X-Received: by 2002:a17:902:ec8a:b0:1d0:6ffd:9df4 with SMTP id x10-20020a170902ec8a00b001d06ffd9df4mr9106544plg.70.1702417644206; Tue, 12 Dec 2023 13:47:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702417644; cv=none; d=google.com; s=arc-20160816; b=yh48H1KJsAADsZv9Uy2AJztSq99FlHFgjycwhXx54ihOvohu8yR2R9uvRPOSUckITr WwrgEyiCFXx5+oT8At6XhtJ7tgWcFRy5JYp+TloRLbMvoJRNrsQ2xPy3euAVh1quPHLk inSO1gKeoIafLGSRL9tbLDPKwS6x+5crGGg28/feOkJ5jwxV0+HsTxaSr0ZuYFRHHJTQ nrh9ofSe+2Dgoc0XasLftMlt/R/Y+v+iWqVwzJOYXcY2HXwkm+wzFIePiIGEFRAYRbgy 2hiJt58GyEPJZm9OOmbhlSHgU5fVARRhPXFtdpngTGABa442Dksn23nFV3+RXT4KYhKh G+GQ== 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=HLn7mgpL3a91MBd10+RVXFtbeOExgBggkTGolEDUWz0=; fh=ihV95EGQZHTeLCrHixA2xGpLZfSI7OXKcPTASJMGKAg=; b=TgNkOR1Tcuwcavqcdy4hFlU6hjYeq/j4Y5Rg4A2V1W1cevCC6PIff5ycTOFp7+xzpN Y/vaf7WlxToBF1urgounqKkj8Gbii3UIrDw4hIhVn+PJayNSKjVTAwTyJnogEPfXu7ZT dwHFf5SOnnUCHKOIobVHilL+wPBTRw62BRid9MbYD8J29ikHd3FOLZnq7eCNCgHSHhM1 1ScvbtLtnjC6NyEP+MV0GF1epu7GfpjXidk+JzHp8qS6hzrBQGoXnt6cWcJZICj8NLmC oOvVGYoZsLXoMSm0p0Jw7xkLIZL0xIMnkfICLEDPJSD2p+p5pzDc1ZJvT/BFlAgscOQl cnyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=raybKYX8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id h5-20020a170902f7c500b001d0725baa37si8220886plw.169.2023.12.12.13.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 13:47:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=raybKYX8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5C5C5804C571; Tue, 12 Dec 2023 13:47:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235173AbjLLVrA (ORCPT + 99 others); Tue, 12 Dec 2023 16:47:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235162AbjLLVq6 (ORCPT ); Tue, 12 Dec 2023 16:46:58 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 450EAB9 for ; Tue, 12 Dec 2023 13:47:05 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4C01C433C7; Tue, 12 Dec 2023 21:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702417624; bh=GEbphLNtH08LYd0Afzr3nGiRgbiKfgbz66e9KqMpUhU=; h=From:To:Cc:Subject:Date:From; b=raybKYX8pD28eWvS9kJTUl17VqcRAmZWstq0aEf1C5YsyMLoc/U6BK4UMr4to8xgu Py/EVmYq86jMuQpfTSQrmFfU0X10fGjEVGaklTTf4buECe/CUdzkkYlAJAjNdoyNrt amBFsljgtiA0eQQQKmFzf/W+n+ILhvvBUUBTNazhzkjSnnxCHnGTXqnuUXaf+M+znV y0Z39pyNU1P+BdG9XIzmUUjYufwwvnAaT8yYxL5Vtps3Omv25TLyRfLvuEr2OE9gNS R+eOyk6olNvcyMhMsioZHrRdYAhvLmPEeGTMhc2vGQ3HSjPkaVbWeztI2suV8rejIY ITWUOrZ8Vc+aA== From: Arnd Bergmann To: Sebastian Reichel , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Nathan Chancellor , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: Arnd Bergmann , Nick Desaulniers , Bill Wendling , Justin Stitt , Yangtao Li , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] power: reset: at91: mark at91_wakeup_status non-__init Date: Tue, 12 Dec 2023 22:46:49 +0100 Message-Id: <20231212214658.213510-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=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Dec 2023 13:47:20 -0800 (PST) From: Arnd Bergmann Two copies of the at91_wakeup_status() function are called by the respective probe() callbacks and are marked __init, but the probe functions are no longer annotated that way. This works with gcc because the functions always get inlined, but clang keeps them separate, which can lead to executing freed memory: WARNING: modpost: vmlinux: section mismatch in reference: at91_poweroff_probe+0x80 (section: .text) -> at91_wakeup_status (section: .init.text) WARNING: modpost: vmlinux: section mismatch in reference: at91_shdwc_probe+0xcc (section: .text) -> at91_wakeup_status (section: .init.text) Drop the incorrect annotation on these. Fixes: 099806de68b7 ("power: reset: at91-poweroff: Stop using module_platform_driver_probe()") Fixes: dde74a5de817 ("power: reset: at91-sama5d2_shdwc: Stop using module_platform_driver_probe()") Signed-off-by: Arnd Bergmann --- drivers/power/reset/at91-poweroff.c | 2 +- drivers/power/reset/at91-sama5d2_shdwc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/reset/at91-poweroff.c b/drivers/power/reset/at91-poweroff.c index 126e774e210c..93eece027865 100644 --- a/drivers/power/reset/at91-poweroff.c +++ b/drivers/power/reset/at91-poweroff.c @@ -57,7 +57,7 @@ static struct shdwc { void __iomem *mpddrc_base; } at91_shdwc; -static void __init at91_wakeup_status(struct platform_device *pdev) +static void at91_wakeup_status(struct platform_device *pdev) { const char *reason; u32 reg = readl(at91_shdwc.shdwc_base + AT91_SHDW_SR); diff --git a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c index af95c7b39cb3..959ce0dbe91d 100644 --- a/drivers/power/reset/at91-sama5d2_shdwc.c +++ b/drivers/power/reset/at91-sama5d2_shdwc.c @@ -107,7 +107,7 @@ static const unsigned long long sdwc_dbc_period[] = { 0, 3, 32, 512, 4096, 32768, }; -static void __init at91_wakeup_status(struct platform_device *pdev) +static void at91_wakeup_status(struct platform_device *pdev) { struct shdwc *shdw = platform_get_drvdata(pdev); const struct reg_config *rcfg = shdw->rcfg; -- 2.39.2