PCI: Use SZ_* instead of literals in setup-bus.c
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 16 Dec 2024 17:56:13 +0000 (19:56 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 18 Feb 2025 21:40:52 +0000 (15:40 -0600)
Convert literals in setup-bus.c to SZ_* defines that make the size more
human readable.

As the code is now self-explanatory, eliminate comments about the size.

Link: https://lore.kernel.org/r/20241216175632.4175-7-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Xiaochun Lee <lixc17@lenovo.com>
drivers/pci/setup-bus.c

index 7c966e3f5060d90bdadb0e7fb8603e65ed519a46..fd6b89c22df3f3757da8fb60c986b18b626b87a3 100644 (file)
@@ -841,9 +841,9 @@ resource_size_t __weak pcibios_window_alignment(struct pci_bus *bus,
        return 1;
 }
 
-#define PCI_P2P_DEFAULT_MEM_ALIGN      0x100000        /* 1MiB */
-#define PCI_P2P_DEFAULT_IO_ALIGN       0x1000          /* 4KiB */
-#define PCI_P2P_DEFAULT_IO_ALIGN_1K    0x400           /* 1KiB */
+#define PCI_P2P_DEFAULT_MEM_ALIGN      SZ_1M
+#define PCI_P2P_DEFAULT_IO_ALIGN       SZ_4K
+#define PCI_P2P_DEFAULT_IO_ALIGN_1K    SZ_1K
 
 static resource_size_t window_alignment(struct pci_bus *bus, unsigned long type)
 {
@@ -908,7 +908,7 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
                                continue;
                        r_size = resource_size(r);
 
-                       if (r_size < 0x400)
+                       if (r_size < SZ_1K)
                                /* Might be re-aligned for ISA */
                                size += r_size;
                        else