diff mbox series

[PULL,1/9] hw/acpi-build: Make assignment statement of next_base easy to read

Message ID 20171005203638.19255-2-ehabkost@redhat.com
State New
Headers show
Series [PULL,1/9] hw/acpi-build: Make assignment statement of next_base easy to read | expand

Commit Message

Eduardo Habkost Oct. 5, 2017, 8:36 p.m. UTC
From: Dou Liyang <douly.fnst@cn.fujitsu.com>

It may be hard to read the assignment statement of "next_base", so

S/next_base += (1ULL << 32) - pcms->below_4g_mem_size;
 /next_base = mem_base + mem_len;

... for readability.

No functionality change.

Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Message-Id: <1504231805-30957-3-git-send-email-douly.fnst@cn.fujitsu.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Igor Mammedov Nov. 28, 2017, 3:07 p.m. UTC | #1
On Thu,  5 Oct 2017 17:36:30 -0300
Eduardo Habkost <ehabkost@redhat.com> wrote:

> From: Dou Liyang <douly.fnst@cn.fujitsu.com>
> 
> It may be hard to read the assignment statement of "next_base", so
> 
> S/next_base += (1ULL << 32) - pcms->below_4g_mem_size;
>  /next_base = mem_base + mem_len;
> 
> ... for readability.
> 
> No functionality change.
> 
> Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
> Message-Id: <1504231805-30957-3-git-send-email-douly.fnst@cn.fujitsu.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Pls, retest/respin once 2.12 dev window is open

> ---
>  hw/i386/acpi-build.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 2af37a9129..73e3443bce 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -2381,7 +2381,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
>              }
>              mem_base = 1ULL << 32;
>              mem_len = next_base - pcms->below_4g_mem_size;
> -            next_base += (1ULL << 32) - pcms->below_4g_mem_size;
> +            next_base = mem_base + mem_len;
>          }
>          numamem = acpi_data_push(table_data, sizeof *numamem);
>          build_srat_memory(numamem, mem_base, mem_len, i - 1,
Dou Liyang Nov. 29, 2017, 1:07 a.m. UTC | #2
Hi, Igor,

At 11/28/2017 11:07 PM, Igor Mammedov wrote:
> On Thu,  5 Oct 2017 17:36:30 -0300
> Eduardo Habkost <ehabkost@redhat.com> wrote:
>
>> From: Dou Liyang <douly.fnst@cn.fujitsu.com>
>>
>> It may be hard to read the assignment statement of "next_base", so
>>
>> S/next_base += (1ULL << 32) - pcms->below_4g_mem_size;
>>  /next_base = mem_base + mem_len;
>>
>> ... for readability.
>>
>> No functionality change.
>>
>> Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
>> Message-Id: <1504231805-30957-3-git-send-email-douly.fnst@cn.fujitsu.com>
>> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> Pls, retest/respin once 2.12 dev window is open
>

Yes, I will.

Thanks,
	dou.

>> ---
>>  hw/i386/acpi-build.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
>> index 2af37a9129..73e3443bce 100644
>> --- a/hw/i386/acpi-build.c
>> +++ b/hw/i386/acpi-build.c
>> @@ -2381,7 +2381,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
>>              }
>>              mem_base = 1ULL << 32;
>>              mem_len = next_base - pcms->below_4g_mem_size;
>> -            next_base += (1ULL << 32) - pcms->below_4g_mem_size;
>> +            next_base = mem_base + mem_len;
>>          }
>>          numamem = acpi_data_push(table_data, sizeof *numamem);
>>          build_srat_memory(numamem, mem_base, mem_len, i - 1,
>
>
>
>
diff mbox series

Patch

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 2af37a9129..73e3443bce 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2381,7 +2381,7 @@  build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine)
             }
             mem_base = 1ULL << 32;
             mem_len = next_base - pcms->below_4g_mem_size;
-            next_base += (1ULL << 32) - pcms->below_4g_mem_size;
+            next_base = mem_base + mem_len;
         }
         numamem = acpi_data_push(table_data, sizeof *numamem);
         build_srat_memory(numamem, mem_base, mem_len, i - 1,