[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 6/9] tests: Rename PAGE_SIZE definitions
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v2 6/9] tests: Rename PAGE_SIZE definitions |
Date: |
Mon, 18 Jan 2021 10:47:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
On 1/18/21 7:38 AM, Jiaxun Yang wrote:
> As per POSIX specification of limits.h [1], OS libc may define
> PAGE_SIZE in limits.h.
>
> Self defined PAGE_SIZE is frequently used in tests, to prevent
> collosion of definition, we give PAGE_SIZE definitons reasonable
> prefixs.
>
> [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> ---
> tests/migration/stress.c | 10 ++---
> tests/qtest/libqos/malloc-pc.c | 4 +-
> tests/qtest/libqos/malloc-spapr.c | 4 +-
> tests/qtest/m25p80-test.c | 54 +++++++++++-----------
> tests/tcg/multiarch/system/memory.c | 6 +--
> tests/test-xbzrle.c | 70 ++++++++++++++---------------
> 6 files changed, 74 insertions(+), 74 deletions(-)
...
> diff --git a/tests/tcg/multiarch/system/memory.c
> b/tests/tcg/multiarch/system/memory.c
> index d124502d73..eb0ec6f8eb 100644
> --- a/tests/tcg/multiarch/system/memory.c
> +++ b/tests/tcg/multiarch/system/memory.c
> @@ -20,12 +20,12 @@
> # error "Target does not specify CHECK_UNALIGNED"
> #endif
>
> -#define PAGE_SIZE 4096 /* nominal 4k "pages" */
> -#define TEST_SIZE (PAGE_SIZE * 4) /* 4 pages */
> +#define MEM_PAGE_SIZE 4096 /* nominal 4k "pages" */
> +#define TEST_SIZE (MEM_PAGE_SIZE * 4) /* 4 pages */
Clearer renaming TEST_PAGE_SIZE and TEST_MEM_SIZE.
If possible using TEST_PAGE_SIZE / TEST_MEM_SIZE:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> #define ARRAY_SIZE(x) ((sizeof(x) / sizeof((x)[0])))
>
> -__attribute__((aligned(PAGE_SIZE)))
> +__attribute__((aligned(MEM_PAGE_SIZE)))
> static uint8_t test_data[TEST_SIZE];
- [PATCH v2 1/9] configure: Add sys/timex.h to probe clock_adjtime, (continued)
- [PATCH v2 1/9] configure: Add sys/timex.h to probe clock_adjtime, Jiaxun Yang, 2021/01/18
- [PATCH v2 2/9] libvhost-user: Include poll.h instead of sys/poll.h, Jiaxun Yang, 2021/01/18
- [PATCH v2 3/9] osdep.h: Remove <sys/signal.h> include, Jiaxun Yang, 2021/01/18
- [PATCH v2 4/9] hw/block/nand: Rename PAGE_SIZE to NAND_PAGE_SIZE, Jiaxun Yang, 2021/01/18
- [PATCH v2 5/9] elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE, Jiaxun Yang, 2021/01/18
- [PATCH v2 6/9] tests: Rename PAGE_SIZE definitions, Jiaxun Yang, 2021/01/18
- Re: [PATCH v2 6/9] tests: Rename PAGE_SIZE definitions,
Philippe Mathieu-Daudé <=
- [PATCH v2 7/9] accel/kvm: avoid using predefined PAGE_SIZE, Jiaxun Yang, 2021/01/18
- [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, Jiaxun Yang, 2021/01/18
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, Daniel P . Berrangé, 2021/01/18
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, Thomas Huth, 2021/01/19
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, Daniel P . Berrangé, 2021/01/19
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, John Snow, 2021/01/26
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, Daniel P . Berrangé, 2021/01/27
- Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux, John Snow, 2021/01/27
[PATCH v2 9/9] gitlab-ci: Add alpine to pipeline, Jiaxun Yang, 2021/01/18