]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: parsers: ofpart: Remove code/data for disabled custom parsers
authorDaniel Palmer <daniel@thingy.jp>
Sun, 4 Jan 2026 10:01:51 +0000 (19:01 +0900)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 19 Jan 2026 10:16:23 +0000 (11:16 +0100)
commit56477aea482dd81e0364d98a02ab805d24242b72
tree9fd0f35a2d4735cadc1a6e3c8985b2833b960f2d
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
mtd: parsers: ofpart: Remove code/data for disabled custom parsers

Currently even if none of the custom parsers are selected a struct
of_device_id and a dummy function that just returns -EOPNOTSUPP is
compiled in for each of them.

Its not obvious from the code but struct of_device_id is massive,
196 or 200 bytes (see link), so this is a lot more wasteful than you'd
think just skimming the code and assuming the wasted size is just the
length of the string with some small overhead.

If they aren't enabled use ifdef's to avoid anything being compiled
in and remove the dummy functions.

Link: https://lore.kernel.org/all/ef59d6fd3b2201b912d5eaa7f7a037d8f9adb744.1636561068.git.geert+renesas@glider.be/
Signed-off-by: Daniel Palmer <daniel@thingy.jp>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/parsers/ofpart_bcm4908.h
drivers/mtd/parsers/ofpart_core.c
drivers/mtd/parsers/ofpart_linksys_ns.h