Ilpo Järvinen f6c7399983 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>
2024-03-05 16:10:17 -06:00
..
2024-01-17 16:23:17 -08:00
2023-10-24 10:54:04 -05:00
2024-01-17 16:23:17 -08:00
2023-10-24 16:55:45 -05:00
2023-08-30 16:59:03 -07:00
2023-10-23 12:17:52 -05:00
2023-10-28 13:30:59 -05:00
2024-01-18 16:22:43 -08:00
2024-01-17 16:23:17 -08:00
2023-09-28 16:49:44 -05:00
2023-10-24 16:55:45 -05:00
2023-11-02 14:05:18 -10:00