diff options
author | Zhen Lei <[email protected]> | 2021-07-13 15:22:36 +0800 |
---|---|---|
committer | Bjorn Helgaas <[email protected]> | 2021-08-20 17:10:43 -0500 |
commit | ca32b5310a1a3835f81f498367f1bb7450c8b67b (patch) | |
tree | 02d05e9e64789543dbc1d82e4f6b97d0057c744f /drivers/pci/controller/dwc | |
parent | a67462fc9de8b958d6a2c2c34d0195733a8c61a6 (diff) |
PCI: Optimize pci_resource_len() to reduce kernel size
pci_resource_end() can be 0 only when pci_resource_start() is 0.
Otherwise, it is definitely an error. In this case, pci_resource_len()
should be regarded as 0. Therefore, determining whether
pci_resource_start() and pci_resource_end() are both 0 can be reduced to
determining only whether pci_resource_end() is 0.
Although only one condition judgment is reduced, the macro function
pci_resource_len() is widely referenced in the kernel. I used defconfig to
compile the latest kernel on X86, and its binary code size was reduced by
about 3KB.
Before:
[ 2] .rela.text RELA 0000000000000000 093bfcb0
0000000001a67168 0000000000000018 I 68 1 8
After:
[ 2] .rela.text RELA 0000000000000000 093bfcb0
0000000001a66598 0000000000000018 I 68 1 8
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Zhen Lei <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Diffstat (limited to 'drivers/pci/controller/dwc')
0 files changed, 0 insertions, 0 deletions