diff mbox series

[v6,2/4] hw/acpi-build: Make assignment statement of next_base easy to read

Message ID 1504231805-30957-3-git-send-email-douly.fnst@cn.fujitsu.com
State New
Headers show
Series None | expand

Commit Message

Dou Liyang Sept. 1, 2017, 2:10 a.m. UTC
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>
---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eduardo Habkost Oct. 10, 2017, 2:29 a.m. UTC | #1
On Fri, Sep 01, 2017 at 10:10:03AM +0800, Dou Liyang wrote:
> 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>

This or the new test case at patch 3/4 seem to have caused build
failures under some circumstances:

https://www.mail-archive.com/qemu-devel@nongnu.org/msg486368.html

I couldn't reproduce the failure yet, but I'm removing this and
patch 3/4 from the queue until this is investigated.

> ---
>  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 a0cf3bf..48525a1 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -2411,7 +2411,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,
> -- 
> 2.5.5
> 
> 
> 
>
Dou Liyang Oct. 10, 2017, 2:34 a.m. UTC | #2
Hi Eduardo,

At 10/10/2017 10:29 AM, Eduardo Habkost wrote:
> On Fri, Sep 01, 2017 at 10:10:03AM +0800, Dou Liyang wrote:
>> 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>
>
> This or the new test case at patch 3/4 seem to have caused build
> failures under some circumstances:
>
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg486368.html
>
> I couldn't reproduce the failure yet, but I'm removing this and
> patch 3/4 from the queue until this is investigated.

Hmm, I see, I will do it.

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 a0cf3bf..48525a1 100644
>> --- a/hw/i386/acpi-build.c
>> +++ b/hw/i386/acpi-build.c
>> @@ -2411,7 +2411,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,
>> --
>> 2.5.5
>>
>>
>>
>>
>
diff mbox series

Patch

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index a0cf3bf..48525a1 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2411,7 +2411,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,