diff options
author | 2024-02-22 13:46:06 +0200 | |
---|---|---|
committer | 2024-03-05 16:10:17 -0600 | |
commit | f6c73999837820f98519bf0146df44e58f20f89c (patch) | |
tree | 1df8728e690737ada86f304b075beb30fd5646cd /drivers/pci/probe.c | |
parent | PCI: Remove obsolete pci_cleanup_rom() declaration (diff) | |
download | linux-f6c73999837820f98519bf0146df44e58f20f89c.tar.gz linux-f6c73999837820f98519bf0146df44e58f20f89c.tar.bz2 linux-f6c73999837820f98519bf0146df44e58f20f89c.zip |
PCI/sysfs: Demacrofy pci_dev_resource_resize_attr(n) functions
pci_dev_resource_resize_attr(n) macro is invoked for six resources,
creating a large footprint function for each resource.
Rework the macro to only create a function that calls a helper function so
the compiler can decide if it warrants to inline the function or not.
With x86_64 defconfig, this saves roughly 2.5kB:
$ scripts/bloat-o-meter drivers/pci/pci-sysfs.o{.old,.new}
add/remove: 1/0 grow/shrink: 0/6 up/down: 512/-2934 (-2422)
Function old new delta
__resource_resize_store - 512 +512
resource5_resize_store 503 14 -489
resource4_resize_store 503 14 -489
resource3_resize_store 503 14 -489
resource2_resize_store 503 14 -489
resource1_resize_store 503 14 -489
resource0_resize_store 500 11 -489
Total: Before=13399, After=10977, chg -18.08%
(The compiler seemingly chose to still inline __resource_resize_show()
which is fine, those functions are not very complex/large.)
Link: https://lore.kernel.org/r/20240222114607.1837-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/probe.c')
0 files changed, 0 insertions, 0 deletions