mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
Defining a static array in a header results in each .c file that includes the header (here: drivers/memory/omap-gpmc.c and drivers/mtd/nand/raw/omap2.c) to contain a copy of that array when compiled to an object file. With sizeof(struct of_device_id[3]) ≥ 588 having omap_nand_ids[] twice just to do two string comparisons is quite some bloat. So move omap_nand_ids[] to the nand driver which actually needs that array for its module meta data and do the compatible check by hand. bloat-o-meter reports for drivers/memory/omap-gpmc.o (ARCH=arm): add/remove: 1/2 grow/shrink: 1/0 up/down: 28/-588 (-560) Function old new delta gpmc_probe_generic_child 2108 2136 +28 omap_nand_ids 588 - -588 Total: Before=18114, After=17554, chg -3.09% (drivers/mtd/nand/raw/omap2.o doesn't change). This allows to drop <linux/mod_devicetable.h> from include/linux/platform_data/mtd-nand-omap2.h (which is my original motivation for this change). Note that this header isn't needed in the two drivers because omap-gpmc.c doesn't use any device id struct and for the nand driver omap2.c of_device_id is already provided via <linux/platform_device.h>. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> |
||
|---|---|---|
| .. | ||
| samsung | ||
| tegra | ||
| .gitignore | ||
| atmel-ebi.c | ||
| brcmstb_dpfe.c | ||
| brcmstb_memc.c | ||
| da8xx-ddrctl.c | ||
| dfl-emif.c | ||
| emif-asm-offsets.c | ||
| emif.c | ||
| emif.h | ||
| fsl_ifc.c | ||
| fsl-corenet-cf.c | ||
| jedec_ddr_data.c | ||
| jedec_ddr.h | ||
| jz4780-nemc.c | ||
| Kconfig | ||
| Makefile | ||
| mtk-smi.c | ||
| mvebu-devbus.c | ||
| of_memory.c | ||
| of_memory.h | ||
| omap-gpmc.c | ||
| pl172.c | ||
| pl353-smc.c | ||
| renesas-rpc-if-regs.h | ||
| renesas-rpc-if.c | ||
| renesas-xspi-if-regs.h | ||
| stm32_omm.c | ||
| stm32-fmc2-ebi.c | ||
| ti-aemif.c | ||
| ti-emif-pm.c | ||
| ti-emif-sram-pm.S | ||