powerpc: 52xx: Make immr_id DT match tables static
authorRob Herring <robh@kernel.org>
Wed, 14 Jun 2023 17:17:23 +0000 (11:17 -0600)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 21 Jun 2023 05:13:56 +0000 (15:13 +1000)
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.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306130405.uTv5yOZD-lkp@intel.com/
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230614171724.2403982-1-robh@kernel.org
arch/powerpc/platforms/52xx/lite5200_pm.c
arch/powerpc/platforms/52xx/mpc52xx_pm.c

index ee29b63..4900f5f 100644 (file)
@@ -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 */
index 549b362..f0c31ae 100644 (file)
@@ -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 */