diff mbox series

nvdimm: release the correct device list

Message ID 20210624110415.187164-1-lizhijian@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show
Series nvdimm: release the correct device list | expand

Commit Message

Li Zhijian June 24, 2021, 11:04 a.m. UTC
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
 hw/acpi/nvdimm.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Igor Mammedov June 29, 2021, 2:05 p.m. UTC | #1
On Thu, 24 Jun 2021 19:04:15 +0800
Li Zhijian <lizhijian@cn.fujitsu.com> wrote:

> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/acpi/nvdimm.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
> index e3d5fe19392..ff317263e85 100644
> --- a/hw/acpi/nvdimm.c
> +++ b/hw/acpi/nvdimm.c
> @@ -355,10 +355,10 @@ nvdimm_build_structure_caps(GArray *structures, uint32_t capabilities)
>  
>  static GArray *nvdimm_build_device_structure(NVDIMMState *state)
>  {
> -    GSList *device_list = nvdimm_get_device_list();
> +    GSList *device_list, *list = nvdimm_get_device_list();
>      GArray *structures = g_array_new(false, true /* clear */, 1);
>  
> -    for (; device_list; device_list = device_list->next) {
> +    for (device_list = list; device_list; device_list = device_list->next) {
>          DeviceState *dev = device_list->data;
>  
>          /* build System Physical Address Range Structure. */
> @@ -373,7 +373,7 @@ static GArray *nvdimm_build_device_structure(NVDIMMState *state)
>          /* build NVDIMM Control Region Structure. */
>          nvdimm_build_structure_dcr(structures, dev);
>      }
> -    g_slist_free(device_list);
> +    g_slist_free(list);
>  
>      if (state->persistence) {
>          nvdimm_build_structure_caps(structures, state->persistence);
> @@ -1339,9 +1339,9 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
>  
>  void nvdimm_build_srat(GArray *table_data)
>  {
> -    GSList *device_list = nvdimm_get_device_list();
> +    GSList *device_list, *list = nvdimm_get_device_list();
>  
> -    for (; device_list; device_list = device_list->next) {
> +    for (device_list = list; device_list; device_list = device_list->next) {
>          AcpiSratMemoryAffinity *numamem = NULL;
>          DeviceState *dev = device_list->data;
>          Object *obj = OBJECT(dev);
> @@ -1356,7 +1356,7 @@ void nvdimm_build_srat(GArray *table_data)
>          build_srat_memory(numamem, addr, size, node,
>                            MEM_AFFINITY_ENABLED | MEM_AFFINITY_NON_VOLATILE);
>      }
> -    g_slist_free(device_list);
> +    g_slist_free(list);
>  }
>  
>  void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data,
Li Zhijian Aug. 3, 2021, 4 a.m. UTC | #2
ping

Any body could help to review/queue this patch ?



On 2021/6/29 22:05, Igor Mammedov wrote:
> On Thu, 24 Jun 2021 19:04:15 +0800
> Li Zhijian <lizhijian@cn.fujitsu.com> wrote:
>
>> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
>
>> ---
>>   hw/acpi/nvdimm.c | 12 ++++++------
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
>> index e3d5fe19392..ff317263e85 100644
>> --- a/hw/acpi/nvdimm.c
>> +++ b/hw/acpi/nvdimm.c
>> @@ -355,10 +355,10 @@ nvdimm_build_structure_caps(GArray *structures, uint32_t capabilities)
>>   
>>   static GArray *nvdimm_build_device_structure(NVDIMMState *state)
>>   {
>> -    GSList *device_list = nvdimm_get_device_list();
>> +    GSList *device_list, *list = nvdimm_get_device_list();
>>       GArray *structures = g_array_new(false, true /* clear */, 1);
>>   
>> -    for (; device_list; device_list = device_list->next) {
>> +    for (device_list = list; device_list; device_list = device_list->next) {
>>           DeviceState *dev = device_list->data;
>>   
>>           /* build System Physical Address Range Structure. */
>> @@ -373,7 +373,7 @@ static GArray *nvdimm_build_device_structure(NVDIMMState *state)
>>           /* build NVDIMM Control Region Structure. */
>>           nvdimm_build_structure_dcr(structures, dev);
>>       }
>> -    g_slist_free(device_list);
>> +    g_slist_free(list);
>>   
>>       if (state->persistence) {
>>           nvdimm_build_structure_caps(structures, state->persistence);
>> @@ -1339,9 +1339,9 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
>>   
>>   void nvdimm_build_srat(GArray *table_data)
>>   {
>> -    GSList *device_list = nvdimm_get_device_list();
>> +    GSList *device_list, *list = nvdimm_get_device_list();
>>   
>> -    for (; device_list; device_list = device_list->next) {
>> +    for (device_list = list; device_list; device_list = device_list->next) {
>>           AcpiSratMemoryAffinity *numamem = NULL;
>>           DeviceState *dev = device_list->data;
>>           Object *obj = OBJECT(dev);
>> @@ -1356,7 +1356,7 @@ void nvdimm_build_srat(GArray *table_data)
>>           build_srat_memory(numamem, addr, size, node,
>>                             MEM_AFFINITY_ENABLED | MEM_AFFINITY_NON_VOLATILE);
>>       }
>> -    g_slist_free(device_list);
>> +    g_slist_free(list);
>>   }
>>   
>>   void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data,
>
>
Li Zhijian Aug. 30, 2021, 1:06 a.m. UTC | #3
ping


On 03/08/2021 12:00, Li, Zhijian wrote:
> ping
>
> Any body could help to review/queue this patch ?
>
>
>
> On 2021/6/29 22:05, Igor Mammedov wrote:
>> On Thu, 24 Jun 2021 19:04:15 +0800
>> Li Zhijian <lizhijian@cn.fujitsu.com> wrote:
>>
>>> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
>> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
>>
>>> ---
>>>   hw/acpi/nvdimm.c | 12 ++++++------
>>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
>>> index e3d5fe19392..ff317263e85 100644
>>> --- a/hw/acpi/nvdimm.c
>>> +++ b/hw/acpi/nvdimm.c
>>> @@ -355,10 +355,10 @@ nvdimm_build_structure_caps(GArray *structures, uint32_t capabilities)
>>>     static GArray *nvdimm_build_device_structure(NVDIMMState *state)
>>>   {
>>> -    GSList *device_list = nvdimm_get_device_list();
>>> +    GSList *device_list, *list = nvdimm_get_device_list();
>>>       GArray *structures = g_array_new(false, true /* clear */, 1);
>>>   -    for (; device_list; device_list = device_list->next) {
>>> +    for (device_list = list; device_list; device_list = device_list->next) {
>>>           DeviceState *dev = device_list->data;
>>>             /* build System Physical Address Range Structure. */
>>> @@ -373,7 +373,7 @@ static GArray *nvdimm_build_device_structure(NVDIMMState *state)
>>>           /* build NVDIMM Control Region Structure. */
>>>           nvdimm_build_structure_dcr(structures, dev);
>>>       }
>>> -    g_slist_free(device_list);
>>> +    g_slist_free(list);
>>>         if (state->persistence) {
>>>           nvdimm_build_structure_caps(structures, state->persistence);
>>> @@ -1339,9 +1339,9 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
>>>     void nvdimm_build_srat(GArray *table_data)
>>>   {
>>> -    GSList *device_list = nvdimm_get_device_list();
>>> +    GSList *device_list, *list = nvdimm_get_device_list();
>>>   -    for (; device_list; device_list = device_list->next) {
>>> +    for (device_list = list; device_list; device_list = device_list->next) {
>>>           AcpiSratMemoryAffinity *numamem = NULL;
>>>           DeviceState *dev = device_list->data;
>>>           Object *obj = OBJECT(dev);
>>> @@ -1356,7 +1356,7 @@ void nvdimm_build_srat(GArray *table_data)
>>>           build_srat_memory(numamem, addr, size, node,
>>>                             MEM_AFFINITY_ENABLED | MEM_AFFINITY_NON_VOLATILE);
>>>       }
>>> -    g_slist_free(device_list);
>>> +    g_slist_free(list);
>>>   }
>>>     void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data,
>>
>>
>
>
>
Li Zhijian Sept. 13, 2021, 6:40 a.m. UTC | #4
ping again




On 30/08/2021 09:04, Li Zhijian wrote:
> ping
>
>
> On 03/08/2021 12:00, Li, Zhijian wrote:
>> ping
>>
>> Any body could help to review/queue this patch ?
>>
>>
>>
>> On 2021/6/29 22:05, Igor Mammedov wrote:
>>> On Thu, 24 Jun 2021 19:04:15 +0800
>>> Li Zhijian <lizhijian@cn.fujitsu.com> wrote:
>>>
>>>> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
>>> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
>>>
>>>> ---
>>>>   hw/acpi/nvdimm.c | 12 ++++++------
>>>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
>>>> index e3d5fe19392..ff317263e85 100644
>>>> --- a/hw/acpi/nvdimm.c
>>>> +++ b/hw/acpi/nvdimm.c
>>>> @@ -355,10 +355,10 @@ nvdimm_build_structure_caps(GArray *structures, uint32_t capabilities)
>>>>     static GArray *nvdimm_build_device_structure(NVDIMMState *state)
>>>>   {
>>>> -    GSList *device_list = nvdimm_get_device_list();
>>>> +    GSList *device_list, *list = nvdimm_get_device_list();
>>>>       GArray *structures = g_array_new(false, true /* clear */, 1);
>>>>   -    for (; device_list; device_list = device_list->next) {
>>>> +    for (device_list = list; device_list; device_list = device_list->next) {
>>>>           DeviceState *dev = device_list->data;
>>>>             /* build System Physical Address Range Structure. */
>>>> @@ -373,7 +373,7 @@ static GArray *nvdimm_build_device_structure(NVDIMMState *state)
>>>>           /* build NVDIMM Control Region Structure. */
>>>>           nvdimm_build_structure_dcr(structures, dev);
>>>>       }
>>>> -    g_slist_free(device_list);
>>>> +    g_slist_free(list);
>>>>         if (state->persistence) {
>>>>           nvdimm_build_structure_caps(structures, state->persistence);
>>>> @@ -1339,9 +1339,9 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
>>>>     void nvdimm_build_srat(GArray *table_data)
>>>>   {
>>>> -    GSList *device_list = nvdimm_get_device_list();
>>>> +    GSList *device_list, *list = nvdimm_get_device_list();
>>>>   -    for (; device_list; device_list = device_list->next) {
>>>> +    for (device_list = list; device_list; device_list = device_list->next) {
>>>>           AcpiSratMemoryAffinity *numamem = NULL;
>>>>           DeviceState *dev = device_list->data;
>>>>           Object *obj = OBJECT(dev);
>>>> @@ -1356,7 +1356,7 @@ void nvdimm_build_srat(GArray *table_data)
>>>>           build_srat_memory(numamem, addr, size, node,
>>>>                             MEM_AFFINITY_ENABLED | MEM_AFFINITY_NON_VOLATILE);
>>>>       }
>>>> -    g_slist_free(device_list);
>>>> +    g_slist_free(list);
>>>>   }
>>>>     void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data,
>>>
>>>
>>
>>
>>
>
Igor Mammedov Sept. 17, 2021, 12:59 p.m. UTC | #5
On Mon, 13 Sep 2021 06:40:01 +0000
"lizhijian@fujitsu.com" <lizhijian@fujitsu.com> wrote:

> ping again

Michael,

can you include this in your next pull req, please?

> 
> 
> 
> On 30/08/2021 09:04, Li Zhijian wrote:
> > ping
> >
> >
> > On 03/08/2021 12:00, Li, Zhijian wrote:  
> >> ping
> >>
> >> Any body could help to review/queue this patch ?
> >>
> >>
> >>
> >> On 2021/6/29 22:05, Igor Mammedov wrote:  
> >>> On Thu, 24 Jun 2021 19:04:15 +0800
> >>> Li Zhijian <lizhijian@cn.fujitsu.com> wrote:
> >>>  
> >>>> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>  
> >>> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> >>>  
> >>>> ---
> >>>>   hw/acpi/nvdimm.c | 12 ++++++------
> >>>>   1 file changed, 6 insertions(+), 6 deletions(-)
> >>>>
> >>>> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
> >>>> index e3d5fe19392..ff317263e85 100644
> >>>> --- a/hw/acpi/nvdimm.c
> >>>> +++ b/hw/acpi/nvdimm.c
> >>>> @@ -355,10 +355,10 @@ nvdimm_build_structure_caps(GArray *structures, uint32_t capabilities)
> >>>>     static GArray *nvdimm_build_device_structure(NVDIMMState *state)
> >>>>   {
> >>>> -    GSList *device_list = nvdimm_get_device_list();
> >>>> +    GSList *device_list, *list = nvdimm_get_device_list();
> >>>>       GArray *structures = g_array_new(false, true /* clear */, 1);
> >>>>   -    for (; device_list; device_list = device_list->next) {
> >>>> +    for (device_list = list; device_list; device_list = device_list->next) {
> >>>>           DeviceState *dev = device_list->data;
> >>>>             /* build System Physical Address Range Structure. */
> >>>> @@ -373,7 +373,7 @@ static GArray *nvdimm_build_device_structure(NVDIMMState *state)
> >>>>           /* build NVDIMM Control Region Structure. */
> >>>>           nvdimm_build_structure_dcr(structures, dev);
> >>>>       }
> >>>> -    g_slist_free(device_list);
> >>>> +    g_slist_free(list);
> >>>>         if (state->persistence) {
> >>>>           nvdimm_build_structure_caps(structures, state->persistence);
> >>>> @@ -1339,9 +1339,9 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
> >>>>     void nvdimm_build_srat(GArray *table_data)
> >>>>   {
> >>>> -    GSList *device_list = nvdimm_get_device_list();
> >>>> +    GSList *device_list, *list = nvdimm_get_device_list();
> >>>>   -    for (; device_list; device_list = device_list->next) {
> >>>> +    for (device_list = list; device_list; device_list = device_list->next) {
> >>>>           AcpiSratMemoryAffinity *numamem = NULL;
> >>>>           DeviceState *dev = device_list->data;
> >>>>           Object *obj = OBJECT(dev);
> >>>> @@ -1356,7 +1356,7 @@ void nvdimm_build_srat(GArray *table_data)
> >>>>           build_srat_memory(numamem, addr, size, node,
> >>>>                             MEM_AFFINITY_ENABLED | MEM_AFFINITY_NON_VOLATILE);
> >>>>       }
> >>>> -    g_slist_free(device_list);
> >>>> +    g_slist_free(list);
> >>>>   }
> >>>>     void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data,  
> >>>
> >>>  
> >>
> >>
> >>  
> >
Michael S. Tsirkin Sept. 22, 2021, 6:40 a.m. UTC | #6
On Fri, Sep 17, 2021 at 02:59:33PM +0200, Igor Mammedov wrote:
> On Mon, 13 Sep 2021 06:40:01 +0000
> "lizhijian@fujitsu.com" <lizhijian@fujitsu.com> wrote:
> 
> > ping again
> 
> Michael,
> 
> can you include this in your next pull req, please?

ok

> > 
> > 
> > 
> > On 30/08/2021 09:04, Li Zhijian wrote:
> > > ping
> > >
> > >
> > > On 03/08/2021 12:00, Li, Zhijian wrote:  
> > >> ping
> > >>
> > >> Any body could help to review/queue this patch ?
> > >>
> > >>
> > >>
> > >> On 2021/6/29 22:05, Igor Mammedov wrote:  
> > >>> On Thu, 24 Jun 2021 19:04:15 +0800
> > >>> Li Zhijian <lizhijian@cn.fujitsu.com> wrote:
> > >>>  
> > >>>> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>  
> > >>> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> > >>>  
> > >>>> ---
> > >>>>   hw/acpi/nvdimm.c | 12 ++++++------
> > >>>>   1 file changed, 6 insertions(+), 6 deletions(-)
> > >>>>
> > >>>> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
> > >>>> index e3d5fe19392..ff317263e85 100644
> > >>>> --- a/hw/acpi/nvdimm.c
> > >>>> +++ b/hw/acpi/nvdimm.c
> > >>>> @@ -355,10 +355,10 @@ nvdimm_build_structure_caps(GArray *structures, uint32_t capabilities)
> > >>>>     static GArray *nvdimm_build_device_structure(NVDIMMState *state)
> > >>>>   {
> > >>>> -    GSList *device_list = nvdimm_get_device_list();
> > >>>> +    GSList *device_list, *list = nvdimm_get_device_list();
> > >>>>       GArray *structures = g_array_new(false, true /* clear */, 1);
> > >>>>   -    for (; device_list; device_list = device_list->next) {
> > >>>> +    for (device_list = list; device_list; device_list = device_list->next) {
> > >>>>           DeviceState *dev = device_list->data;
> > >>>>             /* build System Physical Address Range Structure. */
> > >>>> @@ -373,7 +373,7 @@ static GArray *nvdimm_build_device_structure(NVDIMMState *state)
> > >>>>           /* build NVDIMM Control Region Structure. */
> > >>>>           nvdimm_build_structure_dcr(structures, dev);
> > >>>>       }
> > >>>> -    g_slist_free(device_list);
> > >>>> +    g_slist_free(list);
> > >>>>         if (state->persistence) {
> > >>>>           nvdimm_build_structure_caps(structures, state->persistence);
> > >>>> @@ -1339,9 +1339,9 @@ static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
> > >>>>     void nvdimm_build_srat(GArray *table_data)
> > >>>>   {
> > >>>> -    GSList *device_list = nvdimm_get_device_list();
> > >>>> +    GSList *device_list, *list = nvdimm_get_device_list();
> > >>>>   -    for (; device_list; device_list = device_list->next) {
> > >>>> +    for (device_list = list; device_list; device_list = device_list->next) {
> > >>>>           AcpiSratMemoryAffinity *numamem = NULL;
> > >>>>           DeviceState *dev = device_list->data;
> > >>>>           Object *obj = OBJECT(dev);
> > >>>> @@ -1356,7 +1356,7 @@ void nvdimm_build_srat(GArray *table_data)
> > >>>>           build_srat_memory(numamem, addr, size, node,
> > >>>>                             MEM_AFFINITY_ENABLED | MEM_AFFINITY_NON_VOLATILE);
> > >>>>       }
> > >>>> -    g_slist_free(device_list);
> > >>>> +    g_slist_free(list);
> > >>>>   }
> > >>>>     void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data,  
> > >>>
> > >>>  
> > >>
> > >>
> > >>  
> > >
diff mbox series

Patch

diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index e3d5fe19392..ff317263e85 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -355,10 +355,10 @@  nvdimm_build_structure_caps(GArray *structures, uint32_t capabilities)
 
 static GArray *nvdimm_build_device_structure(NVDIMMState *state)
 {
-    GSList *device_list = nvdimm_get_device_list();
+    GSList *device_list, *list = nvdimm_get_device_list();
     GArray *structures = g_array_new(false, true /* clear */, 1);
 
-    for (; device_list; device_list = device_list->next) {
+    for (device_list = list; device_list; device_list = device_list->next) {
         DeviceState *dev = device_list->data;
 
         /* build System Physical Address Range Structure. */
@@ -373,7 +373,7 @@  static GArray *nvdimm_build_device_structure(NVDIMMState *state)
         /* build NVDIMM Control Region Structure. */
         nvdimm_build_structure_dcr(structures, dev);
     }
-    g_slist_free(device_list);
+    g_slist_free(list);
 
     if (state->persistence) {
         nvdimm_build_structure_caps(structures, state->persistence);
@@ -1339,9 +1339,9 @@  static void nvdimm_build_ssdt(GArray *table_offsets, GArray *table_data,
 
 void nvdimm_build_srat(GArray *table_data)
 {
-    GSList *device_list = nvdimm_get_device_list();
+    GSList *device_list, *list = nvdimm_get_device_list();
 
-    for (; device_list; device_list = device_list->next) {
+    for (device_list = list; device_list; device_list = device_list->next) {
         AcpiSratMemoryAffinity *numamem = NULL;
         DeviceState *dev = device_list->data;
         Object *obj = OBJECT(dev);
@@ -1356,7 +1356,7 @@  void nvdimm_build_srat(GArray *table_data)
         build_srat_memory(numamem, addr, size, node,
                           MEM_AFFINITY_ENABLED | MEM_AFFINITY_NON_VOLATILE);
     }
-    g_slist_free(device_list);
+    g_slist_free(list);
 }
 
 void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data,