[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] vpci: introduce a local vpci_bar variable to modify_decoding()
commit 26bf76b48bbce3e7b126290374c64966dca47561 Author: Roger Pau Monné <roger.pau@xxxxxxxxxx> AuthorDate: Wed Oct 26 14:57:41 2022 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Wed Oct 26 14:57:41 2022 +0200 vpci: introduce a local vpci_bar variable to modify_decoding() This is done to shorten line length in the function in preparation for adding further usages of the vpci_bar data structure. No functional change. Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx> --- xen/drivers/vpci/header.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c index a1c928a0d2..eb9219a49a 100644 --- a/xen/drivers/vpci/header.c +++ b/xen/drivers/vpci/header.c @@ -103,24 +103,26 @@ static void modify_decoding(const struct pci_dev *pdev, uint16_t cmd, for ( i = 0; i < ARRAY_SIZE(header->bars); i++ ) { - if ( !MAPPABLE_BAR(&header->bars[i]) ) + struct vpci_bar *bar = &header->bars[i]; + + if ( !MAPPABLE_BAR(bar) ) continue; - if ( rom_only && header->bars[i].type == VPCI_BAR_ROM ) + if ( rom_only && bar->type == VPCI_BAR_ROM ) { unsigned int rom_pos = (i == PCI_HEADER_NORMAL_NR_BARS) ? PCI_ROM_ADDRESS : PCI_ROM_ADDRESS1; - uint32_t val = header->bars[i].addr | + uint32_t val = bar->addr | (map ? PCI_ROM_ADDRESS_ENABLE : 0); - header->bars[i].enabled = header->rom_enabled = map; + bar->enabled = header->rom_enabled = map; pci_conf_write32(pdev->sbdf, rom_pos, val); return; } if ( !rom_only && - (header->bars[i].type != VPCI_BAR_ROM || header->rom_enabled) ) - header->bars[i].enabled = map; + (bar->type != VPCI_BAR_ROM || header->rom_enabled) ) + bar->enabled = map; } if ( !rom_only ) -- generated by git-patchbot for /home/xen/git/xen.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |