[PATCH] ARM: cns3xxx: Don't allocate PCI addresses on stack

Arnd Bergmann arnd at arndb.de
Mon Aug 25 03:34:25 PDT 2014


On Sunday 24 August 2014 19:51:34 Mark Brown wrote:
> From: Mark Brown <broonie at linaro.org>
> 
> The cns3xxx PCIe code allocates a PCI bus structure on the stack, causing
> warnings due to the excessibe size of the resulting stack frame:
> 
> arch/arm/mach-cns3xxx/pcie.c:311:1: warning: the frame size of 1072 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 
> Avoid this by dynamically allocating the structure, though I am not
> convinced that we should be locally creating the struct pci_bus in the
> first place.
> 
> Signed-off-by: Mark Brown <broonie at linaro.org>
> 

We should certainly not make up a pci_bus here just for the purpose
of calling a common code function that comes back through a callback
to the locally defined cns3xxx_pci_read_config/cns3xxx_pci_write_config.

However, refactoring the code to do it right seems like actual work
and I'm not sure we can find anybody to do it, so your hack seems
like the best approximation.

	Arnd



More information about the linux-arm-kernel mailing list