Skip to contentSkip to conversation

PCI Trivial: remove superfluous code

PATCH In review Cao jin 2 participants 3 messages Nov 23, 2015 – Nov 25, 2015

lore
Share & tools
lore

Cao jin

author
#0 lore raw

PATCH 1/1 PCI Trivial: remove superfluous code

remove superfluous code in do_pci_register_device(). See its caller:
pci_qdev_realize()

---
 hw/pci/pci.c | 1 -
 1 file changed, 1 deletion(-)
hw/pci/pci.c +0 -1
index 168b9cc..4d16da0 100644
@@ -878,7 +878,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
        return NULL;
     }
 
-    pci_dev->devfn = devfn;
     dma_as = pci_device_iommu_address_space(pci_dev);
 
     memory_region_init_alias(&pci_dev->bus_master_enable_region,
Signature · 7 lines
2.1.0


-- 
This message has been scanned for viruses and
dangerous content by FCNIC, and is
believed to be clean.
#1 lore raw
Quoted 13 lines · Cao jin

remove superfluous code in do_pci_register_device(). See its caller:
pci_qdev_realize()

---
  hw/pci/pci.c | 1 -
  1 file changed, 1 deletion(-)
hw/pci/pci.c +0 -0
index 168b9cc..4d16da0 100644

hw/pci/pci.c static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, · line 881

Quoted 4 lines
hw/pci/pci.c +0 -1
@@ -878,7 +878,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
         return NULL;
      }
 
-    pci_dev->devfn = devfn;

Hi, can you please explain why this line is not needed?
As far as I see if do_pci_register_device is called with devfn -1 (auto assign), the devfn will be computed by this function and then passed to pci_dev.

Am I missing anything?

Thanks,
Marcel

Quoted 4 lines
hw/pci/pci.c +0 -0
      dma_as = pci_device_iommu_address_space(pci_dev);
 
      memory_region_init_alias(&pci_dev->bus_master_enable_region,
author
#2 lore raw
Quoted 18 lines · Marcel Apfelbaum
Quoted 17 lines · Cao jin

remove superfluous code in do_pci_register_device(). See its caller:
pci_qdev_realize()

---
  hw/pci/pci.c | 1 -
  1 file changed, 1 deletion(-)
hw/pci/pci.c +0 -0
index 168b9cc..4d16da0 100644
@@ -878,7 +878,6 @@ static PCIDevice *do_pci_register_device(PCIDevice
 *pci_dev, PCIBus *bus,
         return NULL;
      }
 
Quoted 7 lines

hw/pci/pci.c static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, · line 881

Quoted 1 line
hw/pci/pci.c +0 -1
-    pci_dev->devfn = devfn;

Hi, can you please explain why this line is not needed?
As far as I see if do_pci_register_device is called with devfn -1 (auto assign),
the devfn will be computed by this function and then passed to pci_dev.

uh..sorry, my mistake. You remind me... I miss the "auto assign" condition. Please forget this patch...

Quoted 12 lines

Am I missing anything?

Thanks,
Marcel

Quoted 4 lines
hw/pci/pci.c +0 -0
      dma_as = pci_device_iommu_address_space(pci_dev);
 
      memory_region_init_alias(&pci_dev->bus_master_enable_region,
Signature · 7 lines
Yours Sincerely,

Cao Jin

-- 
This message has been scanned for viruses and
dangerous content by Fujitsu, and is believed to be clean.