qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] PCI Trivial: remove superfluous code
@ 2015-11-23 13:19 Cao jin
  2015-11-24 18:30 ` [Qemu-devel] [Qemu-trivial] " Marcel Apfelbaum
  0 siblings, 1 reply; 3+ messages in thread
From: Cao jin @ 2015-11-23 13:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, mst

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

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
 hw/pci/pci.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 168b9cc..4d16da0 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -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,
-- 
2.1.0


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] PCI Trivial: remove superfluous code
  2015-11-23 13:19 [Qemu-devel] [PATCH] PCI Trivial: remove superfluous code Cao jin
@ 2015-11-24 18:30 ` Marcel Apfelbaum
  2015-11-25  1:10   ` Cao jin
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Apfelbaum @ 2015-11-24 18:30 UTC (permalink / raw)
  To: Cao jin, qemu-devel; +Cc: qemu-trivial, mst

On 11/23/2015 03:19 PM, Cao jin wrote:
> remove superfluous code in do_pci_register_device(). See its caller:
> pci_qdev_realize()
>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
>   hw/pci/pci.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 168b9cc..4d16da0 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -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


>       dma_as = pci_device_iommu_address_space(pci_dev);
>
>       memory_region_init_alias(&pci_dev->bus_master_enable_region,
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] PCI Trivial: remove superfluous code
  2015-11-24 18:30 ` [Qemu-devel] [Qemu-trivial] " Marcel Apfelbaum
@ 2015-11-25  1:10   ` Cao jin
  0 siblings, 0 replies; 3+ messages in thread
From: Cao jin @ 2015-11-25  1:10 UTC (permalink / raw)
  To: marcel, qemu-devel; +Cc: qemu-trivial, mst



On 11/25/2015 02:30 AM, Marcel Apfelbaum wrote:
> On 11/23/2015 03:19 PM, Cao jin wrote:
>> remove superfluous code in do_pci_register_device(). See its caller:
>> pci_qdev_realize()
>>
>> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
>> ---
>>   hw/pci/pci.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
>> index 168b9cc..4d16da0 100644
>> --- a/hw/pci/pci.c
>> +++ b/hw/pci/pci.c
>> @@ -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.
>

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

> Am I missing anything?
>
> Thanks,
> Marcel
>
>
>>       dma_as = pci_device_iommu_address_space(pci_dev);
>>
>>       memory_region_init_alias(&pci_dev->bus_master_enable_region,
>>
>
>

-- 
Yours Sincerely,

Cao Jin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-25  1:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-23 13:19 [Qemu-devel] [PATCH] PCI Trivial: remove superfluous code Cao jin
2015-11-24 18:30 ` [Qemu-devel] [Qemu-trivial] " Marcel Apfelbaum
2015-11-25  1:10   ` Cao jin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).