drivers: pcie: Remove magic number

Use definitions instead of magic numbers.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2023-12-22 13:05:14 +02:00 committed by Fabio Baltieri
parent cc920696ed
commit 4a17446636
1 changed files with 2 additions and 1 deletions

View File

@ -159,7 +159,8 @@ static bool pcie_get_bar(pcie_bdf_t bdf,
}
/* IO/memory decode should be disabled before sizing/update BAR. */
pcie_conf_write(bdf, PCIE_CONF_CMDSTAT, cmd_reg & (~0x3));
pcie_conf_write(bdf, PCIE_CONF_CMDSTAT,
cmd_reg & (~(PCIE_CONF_CMDSTAT_IO | PCIE_CONF_CMDSTAT_MEM)));
pcie_conf_write(bdf, reg, 0xFFFFFFFFU);
size = pcie_conf_read(bdf, reg);