Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 180B7C43334 for ; Mon, 18 Jul 2022 21:56:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=suAmnrA1sbAolOsxr/qroXddwNnmjyU7B8Pj7APM2fA=; b=MbYkiLwyYQNYbx IsroEjlDLuJ7e2hJrI0JUI1bFx5SUMtOQjJW99U/lLyivPkCo7xFEpZJJEAhmNhzOiyC50spVJcNO wvz1aYO2qDULwNasOLJq4+rxZK1TPHtHC0uRwlSAkKkBJfq51i4QEJ/rmxjKwBbnHwPCkzgT0PbqA IQH2I1M++suWADGnmCu4kKkncGsJTKpvRF5kp0EemOhH3TXj7yyo07KSWJ3DBf2fGXmmPTDDTdxvY LeAV7F3Ph5SazePfoRa3RBa5x1jwON9BfI+jPtov/rofOy4Jaorzaox+Md7vEMKXRY7RNzkD2Fzsf HbcpauEmUSqUxCegpiTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDYhe-001lpU-5k; Mon, 18 Jul 2022 21:54:58 +0000 Received: from mail.tpi.com ([50.126.108.186]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDYhb-001lew-2I for linux-arm-kernel@lists.infradead.org; Mon, 18 Jul 2022 21:54:56 +0000 Received: from sushi.tpi.com (sushi.tpi.com [10.0.0.212]) by mail.tpi.com (Postfix) with ESMTPA id E451347ECA5F; Mon, 18 Jul 2022 14:54:47 -0700 (PDT) From: Dean Gehnert To: Cc: Dean Gehnert , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: imx6: suspend: Use the size of imx6_suspend() function for fncpy() Date: Mon, 18 Jul 2022 14:54:26 -0700 Message-Id: <20220718215426.21501-1-deang@tpi.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220718_145455_142309_70A838AF X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the size of the imx6_suspend() function for fncpy() instead of the hard coded size of 'MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info)'. Only need to copy the size of the imx6_suspend() function and not extra code space beyond the function. Cc: Russell King Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Fixes: df595746fa69 ("ARM: imx: add suspend in ocram support for i.mx6q") Signed-off-by: Dean Gehnert --- arch/arm/mach-imx/common.h | 2 ++ arch/arm/mach-imx/pm-imx6.c | 2 +- arch/arm/mach-imx/suspend-imx6.S | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 13f3068e9845..c73152786ead 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -96,10 +96,12 @@ int imx_cpu_kill(unsigned int cpu); void imx53_suspend(void __iomem *ocram_vbase); extern const u32 imx53_suspend_sz; void imx6_suspend(void __iomem *ocram_vbase); +extern const u32 imx6_suspend_sz; #else static inline void imx53_suspend(void __iomem *ocram_vbase) {} static const u32 imx53_suspend_sz; static inline void imx6_suspend(void __iomem *ocram_vbase) {} +static const u32 imx6_suspend_sz; #endif void v7_cpu_resume(void); diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index 045b9fdd342d..d467ca05b95f 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c @@ -570,7 +570,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) imx6_suspend_in_ocram_fn = fncpy( suspend_ocram_base + sizeof(*pm_info), &imx6_suspend, - MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info)); + imx6_suspend_sz); __arm_iomem_set_ro(suspend_ocram_base, MX6Q_SUSPEND_OCRAM_SIZE); diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S index e06f946b75b9..ee19ac288a90 100644 --- a/arch/arm/mach-imx/suspend-imx6.S +++ b/arch/arm/mach-imx/suspend-imx6.S @@ -328,3 +328,6 @@ resume: ret lr ENDPROC(imx6_suspend) + +ENTRY(imx6_suspend_sz) + .word . - imx6_suspend -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel