From: Dean Gehnert <deang@tpi.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Dean Gehnert <deang@tpi.com>,
Russell King <linux@armlinux.org.uk>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
NXP Linux Team <linux-imx@nxp.com>,
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 [thread overview]
Message-ID: <20220718215426.21501-1-deang@tpi.com> (raw)
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 <linux@armlinux.org.uk>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
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 <deang@tpi.com>
---
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
reply other threads:[~2022-07-18 22:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220718215426.21501-1-deang@tpi.com \
--to=deang@tpi.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®