powerpc: 52xx: Make immr_id DT match tables static
Subsystems (2)
PATCH 1/1 powerpc: 52xx: Make immr_id DT match tables static
In some builds, the mpc52xx_pm_prepare()/lite5200_pm_prepare() functions generate stack size warnings. The addition of 'struct resource' in commit 2500763dd3db ("powerpc: Use of_address_to_resource()") grew the stack size and is blamed for the warnings. However, the real issue is there's no reason the 'struct of_device_id immr_ids' DT match tables need to be on the stack as they are constant. Declare them as static to move them off the stack.
--- arch/powerpc/platforms/52xx/lite5200_pm.c | 2 +- arch/powerpc/platforms/52xx/mpc52xx_pm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/52xx/lite5200_pm.c +1 -1
@@ -47,7 +47,7 @@ static int lite5200_pm_begin(suspend_state_t state)static int lite5200_pm_prepare (void ) {struct device_node *np; -const struct of_device_id immr_ids[] = { +static const struct of_device_id immr_ids[] = { { .compatible ="fsl,mpc5200-immr" , }, { .compatible ="fsl,mpc5200b-immr" , }, { .type ="soc" , .compatible ="mpc5200" , },/* lite5200 */
arch/powerpc/platforms/52xx/mpc52xx_pm.c +1 -1
@@ -60,7 +60,7 @@ int mpc52xx_set_wakeup_gpio(u8 pin, u8 level)int mpc52xx_pm_prepare (void ) {struct device_node *np; -const struct of_device_id immr_ids[] = { +static const struct of_device_id immr_ids[] = { { .compatible ="fsl,mpc5200-immr" , }, { .compatible ="fsl,mpc5200b-immr" , }, { .type ="soc" , .compatible ="mpc5200" , },/* lite5200 */
Signature · 1 line
2.39.2
Michael Ellerman
AppliedQuoted 9 lines · Rob Herring
In some builds, the mpc52xx_pm_prepare()/lite5200_pm_prepare() functions generate stack size warnings. The addition of 'struct resource' in commit
2500763dd3db("powerpc: Useof_address_to_resource()") grew the stack size and is blamed for the warnings. However, the real issue is there's no reason the 'structof_device_idimmr_ids' DT match tables need to be on the stack as they are constant. Declare them as static to move them off the stack.[...]
Applied to powerpc/next.
[1/1] powerpc: 52xx: Make immr_id DT match tables static
https://git.kernel.org/powerpc/c/d65305bfa6f797712b928bd8f4781380726b70a0
cheers