alistair23-linux/drivers/of
Gavin Shan dddc33e50a drivers/of: Fix build warning in populate_node()
Function populate_node() is used to unflatten FDT blob to device
tree. It supports maximal 64 level of device nodes. There is one
array @fpsizes[64] tracking the full name length of last unflattened
device node in the corresponding level (index of element in the
array - 1). Build warning is seen with CONFIG_FRAME_WARN=1024 like
below on ARM64 as Geert reported. The issue can be reproduced on
PPC64 as well.

  $ make drivers/of/fdt.o
  drivers/of/fdt.c:443:1: warning: the frame size of 1136 bytes is \
  larger than 1024 bytes [-Wframe-larger-than=]

This changes the data type of @fpsizes[i] from "unsigned long" to
"unsigned int" to avoid the build warning. The return value type
of populate_node() and its @fpsize argument is adjusted accordingly.
With this applied, 256 bytes saved from the stack frame on ARM64 and
PPC64 platforms and the above warning isn't seen.

Fixes: 50800082f1 ("drivers/of: Avoid recursively calling unflatten_dt_node()")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
2016-05-19 09:16:35 -05:00
..
unittest-data of/unittest: replace 'selftest' with 'unittest' 2015-03-25 00:53:29 -05:00
address.c DeviceTree updates for 4.5: 2016-01-14 11:13:28 -08:00
base.c of: document refcount incrementation of of_get_cpu_node() 2016-04-25 10:06:39 -05:00
device.c of: to support binding numa node to specified device in devicetree 2015-10-17 22:11:50 -07:00
dynamic.c of: dynamic: changeset prop-update revert fix 2016-05-16 07:29:12 -05:00
fdt.c drivers/of: Fix build warning in populate_node() 2016-05-19 09:16:35 -05:00
fdt_address.c of: earlycon: Move address translation to of_setup_earlycon() 2016-02-06 22:07:37 -08:00
irq.c of/irq: Fix msi-map calculation for nonzero rid-base 2016-02-11 16:51:41 -06:00
Kconfig of: add config option to enable building of all dtbs 2015-10-27 16:12:13 -05:00
Makefile of: clean-up unnecessary libfdt include paths 2015-06-04 20:16:47 -05:00
of_mdio.c of_mdio: use PTR_ERR_OR_ZERO() 2016-03-14 15:31:58 -04:00
of_mtd.c of_mtd: Add helpers to get ECC strength and ECC step size 2014-03-10 22:42:28 -07:00
of_net.c of_net: factor out repetitive code from of_get_mac_address() 2015-03-29 08:56:17 +01:00
of_pci.c PCI: Remove includes of empty asm-generic/pci-bridge.h 2016-02-05 16:28:36 -06:00
of_pci_irq.c of_pci_irq: Silence bogus "of_irq_parse_pci() failed ..." messages. 2015-09-17 14:46:11 -05:00
of_private.h drivers/of: Export OF changeset functions 2016-01-13 16:10:37 -06:00
of_reserved_mem.c of: alloc anywhere from memblock if range not specified 2016-03-03 16:50:30 -06:00
overlay.c drivers/of: Export OF changeset functions 2016-01-13 16:10:37 -06:00
pdt.c of: Eliminate of_allnodes list 2014-11-04 13:29:38 +00:00
platform.c of/platform: export of_default_bus_match_table 2016-01-05 09:20:44 -06:00
resolver.c of: resolver: Add missing of_node_get and of_node_put 2016-02-13 13:35:32 -06:00
unittest.c drivers/of: Specify parent node in of_fdt_unflatten_tree() 2016-05-16 07:22:35 -05:00