Skip to contentSkip to conversation

i440fx-test: remove ARRAY_SIZE redefinition

PATCH Applied Emilio G. Cota 4 participants 5 messages Apr 26, 2015 – Apr 29, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i440fx-test: remove ARRAY_SIZE redefinition

It's defined in osdep.h and shouldn't be redefined here.

---
 tests/i440fx-test.c | 2 --
 1 file changed, 2 deletions(-)
tests/i440fx-test.c +0 -2
index d0bc8de..33a7ecb 100644
@@ -27,8 +27,6 @@
 
 #define BROKEN 1
 
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
 typedef struct TestData
 {
     int num_cpus;
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Emilio G. Cota

It's defined in osdep.h and shouldn't be redefined here.

It looks like there may be another one too:

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

Regards,
Peter

Quoted 21 lines
---
 tests/i440fx-test.c | 2 --
 1 file changed, 2 deletions(-)
tests/i440fx-test.c +0 -3
index d0bc8de..33a7ecb 100644
@@ -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

#2 lore raw
Quoted 7 lines · Peter Crosthwaite
Quoted 3 lines · Emilio G. Cota

It's defined in osdep.h and shouldn't be redefined here.

Thanks for having a look!

Quoted 3 lines

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

Reviewed-by on v1 1/1
#3 lore raw
In reply to Emilio G. Cota
Quoted 13 lines · Emilio G. Cota

It's defined in osdep.h and shouldn't be redefined here.

---
 tests/i440fx-test.c | 2 --
 1 file changed, 2 deletions(-)
tests/i440fx-test.c +0 -0
index d0bc8de..33a7ecb 100644

tests/i440fx-test.c line 32

Quoted 8 lines
tests/i440fx-test.c +0 -2
@@ -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 [email protected] so that Michael will notice this patch.

Paolo

#4 lore raw

Applied to -trivial, thanks!
So much for removing one line :)

/mjt