[Qemu-devel] [PATCH 25/29] libqos: use ARRAY_SIZE macro

Philippe Mathieu-Daudé posted 29 patches 8 years, 6 months ago
Only 28 patches received!
[Qemu-devel] [PATCH 25/29] libqos: use ARRAY_SIZE macro
Posted by Philippe Mathieu-Daudé 8 years, 6 months ago
Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---

No entry in MAINTAINERS for tests/libqos/* does it deserve it's own entry?

 tests/libqos/libqos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c
index 6226546c28..0edb7e99ba 100644
--- a/tests/libqos/libqos.c
+++ b/tests/libqos/libqos.c
@@ -258,7 +258,7 @@ void generate_pattern(void *buffer, size_t len, size_t cycle_len)
     p = rand() % 256;
     for (i = 0; i < len; i++) {
         tx[i] = p++ % 256;
-        if (i % cycle_len == 0) {
+        if (QEMU_IS_ALIGNED(i, cycle_len)) {
             p = rand() % 256;
         }
     }
-- 
2.13.2


Re: [Qemu-devel] [PATCH 25/29] libqos: use ARRAY_SIZE macro
Posted by Marc-André Lureau 8 years, 6 months ago
On Mon, Jul 17, 2017 at 11:10 PM, Philippe Mathieu-Daudé
<f4bug@amsat.org> wrote:
> Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


>
> No entry in MAINTAINERS for tests/libqos/* does it deserve it's own entry?
>

It would, do you want to candidate? :)

>  tests/libqos/libqos.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c
> index 6226546c28..0edb7e99ba 100644
> --- a/tests/libqos/libqos.c
> +++ b/tests/libqos/libqos.c
> @@ -258,7 +258,7 @@ void generate_pattern(void *buffer, size_t len, size_t cycle_len)
>      p = rand() % 256;
>      for (i = 0; i < len; i++) {
>          tx[i] = p++ % 256;
> -        if (i % cycle_len == 0) {
> +        if (QEMU_IS_ALIGNED(i, cycle_len)) {
>              p = rand() % 256;
>          }
>      }
> --
> 2.13.2
>
>



-- 
Marc-André Lureau

Re: [Qemu-devel] [PATCH 25/29] libqos: use ARRAY_SIZE macro
Posted by Laurent Vivier 8 years, 6 months ago
On 18/07/2017 08:10, Philippe Mathieu-Daudé wrote:
> Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> 
> No entry in MAINTAINERS for tests/libqos/* does it deserve it's own entry?
> 
>  tests/libqos/libqos.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c
> index 6226546c28..0edb7e99ba 100644
> --- a/tests/libqos/libqos.c
> +++ b/tests/libqos/libqos.c
> @@ -258,7 +258,7 @@ void generate_pattern(void *buffer, size_t len, size_t cycle_len)
>      p = rand() % 256;
>      for (i = 0; i < len; i++) {
>          tx[i] = p++ % 256;
> -        if (i % cycle_len == 0) {
> +        if (QEMU_IS_ALIGNED(i, cycle_len)) {
>              p = rand() % 256;
>          }
>      }
> 

The title doesn't reflect the real change.

otherwise:

Reviewed-by: Laurent Vivier <lvivier@redhat.com>

Laurent

Re: [Qemu-devel] [PATCH 25/29] libqos: use ARRAY_SIZE macro
Posted by Philippe Mathieu-Daudé 8 years, 6 months ago
On Tue, Jul 18, 2017 at 8:58 AM, Laurent Vivier <lvivier@redhat.com> wrote:
> On 18/07/2017 08:10, Philippe Mathieu-Daudé wrote:
[...]
>
> The title doesn't reflect the real change.

Good catch ;) too much rebase...

>
> otherwise:
>
> Reviewed-by: Laurent Vivier <lvivier@redhat.com>

Thanks!

>
> Laurent