qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] util/oslib-win32: Fix _aligned_malloc() arguments order
@ 2021-01-11  0:16 Philippe Mathieu-Daudé
  2021-01-11  3:44 ` 罗勇刚(Yonggang Luo)
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-11  0:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Stefan Weil, Volker Rümelin, Richard Henderson,
	Philippe Mathieu-Daudé, 罗勇刚

Commit dfbd0b873a8 inadvertently swapped the arguments
of _aligned_malloc(), correct it to fix [*]:

  G_TEST_SRCDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/tests
  G_TEST_BUILDDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/build/tests
  tests/test-qht.exe --tap -k
  ERROR test-qht - too few tests run (expected 2, got 0)
  make: *** [Makefile.mtest:256: run-test-30] Error 1

[*] https://cirrus-ci.com/task/6055645751279616?command=test#L593

Fixes: dfbd0b873a8 ("util/oslib-win32: Use _aligned_malloc for qemu_try_memalign")
Reported-by: Yonggang Luo <luoyonggang@gmail.com>
Reported-by: Volker Rümelin <vr_qemu@t-online.de>
Suggested-by: Volker Rümelin <vr_qemu@t-online.de>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 util/oslib-win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index e6f83e10edb..f68b8012bb8 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -59,7 +59,7 @@ void *qemu_try_memalign(size_t alignment, size_t size)
 
     g_assert(size != 0);
     g_assert(is_power_of_2(alignment));
-    ptr = _aligned_malloc(alignment, size);
+    ptr = _aligned_malloc(size, alignment);
     trace_qemu_memalign(alignment, size, ptr);
     return ptr;
 }
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] util/oslib-win32: Fix _aligned_malloc() arguments order
  2021-01-11  0:16 [PATCH] util/oslib-win32: Fix _aligned_malloc() arguments order Philippe Mathieu-Daudé
@ 2021-01-11  3:44 ` 罗勇刚(Yonggang Luo)
  0 siblings, 0 replies; 2+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2021-01-11  3:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Stefan Weil, Thomas Huth, Volker Rümelin, Richard Henderson,
	qemu-level

[-- Attachment #1: Type: text/plain, Size: 1685 bytes --]

On Sun, Jan 10, 2021 at 4:16 PM Philippe Mathieu-Daudé <f4bug@amsat.org>
wrote:
>
> Commit dfbd0b873a8 inadvertently swapped the arguments
> of _aligned_malloc(), correct it to fix [*]:
>
>
G_TEST_SRCDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/tests
>
G_TEST_BUILDDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/build/tests
>   tests/test-qht.exe --tap -k
>   ERROR test-qht - too few tests run (expected 2, got 0)
>   make: *** [Makefile.mtest:256: run-test-30] Error 1
>
> [*] https://cirrus-ci.com/task/6055645751279616?command=test#L593
>
> Fixes: dfbd0b873a8 ("util/oslib-win32: Use _aligned_malloc for
qemu_try_memalign")
> Reported-by: Yonggang Luo <luoyonggang@gmail.com>
> Reported-by: Volker Rümelin <vr_qemu@t-online.de>
> Suggested-by: Volker Rümelin <vr_qemu@t-online.de>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  util/oslib-win32.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/util/oslib-win32.c b/util/oslib-win32.c
> index e6f83e10edb..f68b8012bb8 100644
> --- a/util/oslib-win32.c
> +++ b/util/oslib-win32.c
> @@ -59,7 +59,7 @@ void *qemu_try_memalign(size_t alignment, size_t size)
>
>      g_assert(size != 0);
>      g_assert(is_power_of_2(alignment));
> -    ptr = _aligned_malloc(alignment, size);
> +    ptr = _aligned_malloc(size, alignment);
>      trace_qemu_memalign(alignment, size, ptr);
>      return ptr;
>  }
> --
> 2.26.2
>

Oh, sorry, you 've fixed this. ignore my patch

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>

--
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo

[-- Attachment #2: Type: text/html, Size: 2330 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-11  3:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-11  0:16 [PATCH] util/oslib-win32: Fix _aligned_malloc() arguments order Philippe Mathieu-Daudé
2021-01-11  3:44 ` 罗勇刚(Yonggang Luo)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).