diff mbox series

[qemu,v2] pci: Initialize pci_dev->name before use

Message ID 20170915063552.33868-1-aik@ozlabs.ru
State New
Headers show
Series [qemu,v2] pci: Initialize pci_dev->name before use | expand

Commit Message

Alexey Kardashevskiy Sept. 15, 2017, 6:35 a.m. UTC
This moves pci_dev->name initialization earlier so
pci_dev->bus_master_as could get a name instead of an empty string.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Changes:
v2:
* fixed mistype in the commit log
* added "rb"
---
 hw/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexey Kardashevskiy Oct. 15, 2017, 3:24 a.m. UTC | #1
On 03/10/17 13:10, Alexey Kardashevskiy wrote:
> On 15/09/17 16:35, Alexey Kardashevskiy wrote:
>> This moves pci_dev->name initialization earlier so
>> pci_dev->bus_master_as could get a name instead of an empty string.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Ping?

Ping?


> 
> 
>> ---
>> Changes:
>> v2:
>> * fixed mistype in the commit log
>> * added "rb"
>> ---
>>  hw/pci/pci.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
>> index 21e203b056..353195d154 100644
>> --- a/hw/pci/pci.c
>> +++ b/hw/pci/pci.c
>> @@ -1020,6 +1020,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
>>  
>>      pci_dev->devfn = devfn;
>>      pci_dev->requester_id_cache = pci_req_id_cache_get(pci_dev);
>> +    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
>>  
>>      memory_region_init(&pci_dev->bus_master_container_region, OBJECT(pci_dev),
>>                         "bus master container", UINT64_MAX);
>> @@ -1029,7 +1030,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
>>      if (qdev_hotplug) {
>>          pci_init_bus_master(pci_dev);
>>      }
>> -    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
>>      pci_dev->irq_state = 0;
>>      pci_config_alloc(pci_dev);
>>  
>>
> 
>
Michael S. Tsirkin Oct. 15, 2017, 3:31 a.m. UTC | #2
On Sun, Oct 15, 2017 at 02:24:17PM +1100, Alexey Kardashevskiy wrote:
> On 03/10/17 13:10, Alexey Kardashevskiy wrote:
> > On 15/09/17 16:35, Alexey Kardashevskiy wrote:
> >> This moves pci_dev->name initialization earlier so
> >> pci_dev->bus_master_as could get a name instead of an empty string.
> >>
> >> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> >> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > 
> > Ping?
> 
> Ping?

I can't find v2 in either qemu or my personal mailbox.

> 
> > 
> > 
> >> ---
> >> Changes:
> >> v2:
> >> * fixed mistype in the commit log
> >> * added "rb"
> >> ---
> >>  hw/pci/pci.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> >> index 21e203b056..353195d154 100644
> >> --- a/hw/pci/pci.c
> >> +++ b/hw/pci/pci.c
> >> @@ -1020,6 +1020,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
> >>  
> >>      pci_dev->devfn = devfn;
> >>      pci_dev->requester_id_cache = pci_req_id_cache_get(pci_dev);
> >> +    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
> >>  
> >>      memory_region_init(&pci_dev->bus_master_container_region, OBJECT(pci_dev),
> >>                         "bus master container", UINT64_MAX);
> >> @@ -1029,7 +1030,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
> >>      if (qdev_hotplug) {
> >>          pci_init_bus_master(pci_dev);
> >>      }
> >> -    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
> >>      pci_dev->irq_state = 0;
> >>      pci_config_alloc(pci_dev);
> >>  
> >>
> > 
> > 
> 
> 
> -- 
> Alexey
Alexey Kardashevskiy Oct. 15, 2017, 3:38 a.m. UTC | #3
On 15/10/17 14:31, Michael S. Tsirkin wrote:
> On Sun, Oct 15, 2017 at 02:24:17PM +1100, Alexey Kardashevskiy wrote:
>> On 03/10/17 13:10, Alexey Kardashevskiy wrote:
>>> On 15/09/17 16:35, Alexey Kardashevskiy wrote:
>>>> This moves pci_dev->name initialization earlier so
>>>> pci_dev->bus_master_as could get a name instead of an empty string.
>>>>
>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>>
>>> Ping?
>>
>> Ping?
> 
> I can't find v2 in either qemu or my personal mailbox.


Few weeks ago qemu-devel@ list admins were playing with list-id, may be
that's why it missed your inbox.

It hit patchwork though: https://patchwork.ozlabs.org/patch/814085/


> 
>>
>>>
>>>
>>>> ---
>>>> Changes:
>>>> v2:
>>>> * fixed mistype in the commit log
>>>> * added "rb"
>>>> ---
>>>>  hw/pci/pci.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
>>>> index 21e203b056..353195d154 100644
>>>> --- a/hw/pci/pci.c
>>>> +++ b/hw/pci/pci.c
>>>> @@ -1020,6 +1020,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
>>>>  
>>>>      pci_dev->devfn = devfn;
>>>>      pci_dev->requester_id_cache = pci_req_id_cache_get(pci_dev);
>>>> +    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
>>>>  
>>>>      memory_region_init(&pci_dev->bus_master_container_region, OBJECT(pci_dev),
>>>>                         "bus master container", UINT64_MAX);
>>>> @@ -1029,7 +1030,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
>>>>      if (qdev_hotplug) {
>>>>          pci_init_bus_master(pci_dev);
>>>>      }
>>>> -    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
>>>>      pci_dev->irq_state = 0;
>>>>      pci_config_alloc(pci_dev);
>>>>  
>>>>
>>>
>>>
>>
>>
>> -- 
>> Alexey
Michael S. Tsirkin Oct. 15, 2017, 3:45 a.m. UTC | #4
On Sun, Oct 15, 2017 at 02:24:17PM +1100, Alexey Kardashevskiy wrote:
> On 03/10/17 13:10, Alexey Kardashevskiy wrote:
> > On 15/09/17 16:35, Alexey Kardashevskiy wrote:
> >> This moves pci_dev->name initialization earlier so
> >> pci_dev->bus_master_as could get a name instead of an empty string.
> >>
> >> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> >> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > 
> > Ping?
> 
> Ping?

Pls repost while you CC me. Thanks!

> 
> > 
> > 
> >> ---
> >> Changes:
> >> v2:
> >> * fixed mistype in the commit log
> >> * added "rb"
> >> ---
> >>  hw/pci/pci.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> >> index 21e203b056..353195d154 100644
> >> --- a/hw/pci/pci.c
> >> +++ b/hw/pci/pci.c
> >> @@ -1020,6 +1020,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
> >>  
> >>      pci_dev->devfn = devfn;
> >>      pci_dev->requester_id_cache = pci_req_id_cache_get(pci_dev);
> >> +    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
> >>  
> >>      memory_region_init(&pci_dev->bus_master_container_region, OBJECT(pci_dev),
> >>                         "bus master container", UINT64_MAX);
> >> @@ -1029,7 +1030,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
> >>      if (qdev_hotplug) {
> >>          pci_init_bus_master(pci_dev);
> >>      }
> >> -    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
> >>      pci_dev->irq_state = 0;
> >>      pci_config_alloc(pci_dev);
> >>  
> >>
> > 
> > 
> 
> 
> -- 
> Alexey
diff mbox series

Patch

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 21e203b056..353195d154 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1020,6 +1020,7 @@  static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
 
     pci_dev->devfn = devfn;
     pci_dev->requester_id_cache = pci_req_id_cache_get(pci_dev);
+    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
 
     memory_region_init(&pci_dev->bus_master_container_region, OBJECT(pci_dev),
                        "bus master container", UINT64_MAX);
@@ -1029,7 +1030,6 @@  static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
     if (qdev_hotplug) {
         pci_init_bus_master(pci_dev);
     }
-    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
     pci_dev->irq_state = 0;
     pci_config_alloc(pci_dev);