diff mbox

i440fx-test: remove ARRAY_SIZE redefinition

Message ID 1430085867-22514-1-git-send-email-cota@braap.org
State New
Headers show

Commit Message

Emilio Cota April 26, 2015, 10:04 p.m. UTC
It's defined in osdep.h and shouldn't be redefined here.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 tests/i440fx-test.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Peter Crosthwaite April 27, 2015, 2:18 a.m. UTC | #1
On Sun, Apr 26, 2015 at 3:04 PM, Emilio G. Cota <cota@braap.org> wrote:
> It's defined in osdep.h and shouldn't be redefined here.
>
> Signed-off-by: Emilio G. Cota <cota@braap.org>


Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

It looks like there may be another one too:

hw/audio/fmopl.c:#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

Regards,
Peter


> ---
>  tests/i440fx-test.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
> index d0bc8de..33a7ecb 100644
> --- a/tests/i440fx-test.c
> +++ b/tests/i440fx-test.c
> @@ -27,8 +27,6 @@
>
>  #define BROKEN 1
>
> -#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
> -
>  typedef struct TestData
>  {
>      int num_cpus;
> --
> 1.9.1
>
>
Emilio Cota April 27, 2015, 3:39 p.m. UTC | #2
On Sun, Apr 26, 2015 at 19:18:41 -0700, Peter Crosthwaite wrote:
> On Sun, Apr 26, 2015 at 3:04 PM, Emilio G. Cota <cota@braap.org> wrote:
> > It's defined in osdep.h and shouldn't be redefined here.
> >
> > Signed-off-by: Emilio G. Cota <cota@braap.org>
> 
> 
> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

Thanks for having a look!

> It looks like there may be another one too:
> 
> hw/audio/fmopl.c:#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

That one is protected by #ifndef ARRAY_SIZE and AFAICT the file does not
include any qemu headers, so we can safely leave it as is.

		Emilio
Paolo Bonzini April 27, 2015, 3:40 p.m. UTC | #3
On 27/04/2015 00:04, Emilio G. Cota wrote:
> It's defined in osdep.h and shouldn't be redefined here.
> 
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>  tests/i440fx-test.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
> index d0bc8de..33a7ecb 100644
> --- a/tests/i440fx-test.c
> +++ b/tests/i440fx-test.c
> @@ -27,8 +27,6 @@
>  
>  #define BROKEN 1
>  
> -#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
> -
>  typedef struct TestData
>  {
>      int num_cpus;
> 

Looks good; I am CCing qemu-trivial@nongnu.org so that Michael will
notice this patch.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo
Michael Tokarev April 29, 2015, 6:31 a.m. UTC | #4
Applied to -trivial, thanks!
So much for removing one line :)

/mjt
diff mbox

Patch

diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c
index d0bc8de..33a7ecb 100644
--- a/tests/i440fx-test.c
+++ b/tests/i440fx-test.c
@@ -27,8 +27,6 @@ 
 
 #define BROKEN 1
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
 typedef struct TestData
 {
     int num_cpus;