Skip to contentSkip to conversation

target-xtensa: mark XtensaConfig structs as unused

PATCH Applied Peter Maydell 3 participants 5 messages Sep 14, 2014 – Oct 23, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-xtensa: mark XtensaConfig structs as unused

The XtensaConfig structs will be defined but not used if they are for the opposite endianness from that of the binary being built; keep the compiler from complaining about this by marking them with the 'unused' attribute.

---
This works, although it's a tad ugly. If anybody wants to suggest something better...

 target-xtensa/core-dc232b.c | 2 +-
 target-xtensa/core-dc233c.c | 2 +-
 target-xtensa/core-fsf.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
target-xtensa/core-dc232b.c +1 -1
index c51e11e..a3b914b 100644
@@ -33,7 +33,7 @@
 #include "core-dc232b/core-isa.h"
 #include "overlay_tool.h"
 
-static const XtensaConfig dc232b = {
+static const XtensaConfig dc232b __attribute__((unused)) = {
     .name = "dc232b",
     .gdb_regmap = {
         .num_regs = 120,
target-xtensa/core-dc233c.c +1 -1
index 42dd64f..ac745d1 100644
@@ -34,7 +34,7 @@
 #include "core-dc233c/core-isa.h"
 #include "overlay_tool.h"
 
-static const XtensaConfig dc233c = {
+static const XtensaConfig dc233c __attribute__((unused)) = {
     .name = "dc233c",
     .gdb_regmap = {
         .num_regs = 121,
target-xtensa/core-fsf.c +1 -1
index 6859bee..cfcc840 100644
@@ -33,7 +33,7 @@
 #include "core-fsf/core-isa.h"
 #include "overlay_tool.h"
 
-static const XtensaConfig fsf = {
+static const XtensaConfig fsf __attribute__((unused)) = {
     .name = "fsf",
     /* GDB for this core is not supported currently */
     .clock_freq_khz = 10000,
Signature · 1 line
2.0.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Peter Maydell

The XtensaConfig structs will be defined but not used if they are for the opposite endianness from that of the binary being built; keep the compiler from complaining about this by marking them with the 'unused' attribute.

---
This works, although it's a tad ugly. If anybody wants to suggest something better...

Fine for me.

Quoted 4 lines
 target-xtensa/core-dc232b.c | 2 +-
 target-xtensa/core-dc233c.c | 2 +-
 target-xtensa/core-fsf.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 2 lines
Thanks.
-- Max
#2 lore raw
Quoted 12 lines · Max Filippov
Quoted 9 lines · Peter Maydell

The XtensaConfig structs will be defined but not used if they are for the opposite endianness from that of the binary being built; keep the compiler from complaining about this by marking them with the 'unused' attribute.

---
This works, although it's a tad ugly. If anybody wants to suggest something better...

Quoted 8 lines

Fine for me.

Quoted 4 lines
 target-xtensa/core-dc232b.c | 2 +-
 target-xtensa/core-dc233c.c | 2 +-
 target-xtensa/core-fsf.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Thanks. I guess we could put this one in through
-trivial ?

Patchwork url:
http://patchwork.ozlabs.org/patch/389115/

-- PMM

#3 lore raw
Quoted 20 lines · Peter Maydell
Quoted 19 lines · Max Filippov
Quoted 9 lines · Peter Maydell

The XtensaConfig structs will be defined but not used if they are for the opposite endianness from that of the binary being built; keep the compiler from complaining about this by marking them with the 'unused' attribute.

---
This works, although it's a tad ugly. If anybody wants to suggest something better...

Fine for me.

Quoted 4 lines
 target-xtensa/core-dc232b.c | 2 +-
 target-xtensa/core-dc233c.c | 2 +-
 target-xtensa/core-fsf.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Quoted 4 lines
Quoted 1 line

Thanks. I guess we could put this one in through
-trivial ?

Yes, please.

Quoted 2 lines

Patchwork url:
http://patchwork.ozlabs.org/patch/389115/

Signature · 2 lines
Thanks.
-- Max
#4 lore raw
In reply to Peter Maydell
Quoted 7 lines · Peter Maydell
Quoted 6 lines · Max Filippov
Quoted 4 lines · Peter Maydell

The XtensaConfig structs will be defined but not used if they are for the opposite endianness from that of the binary being built; keep the compiler from complaining about this by marking them with the 'unused' attribute.

Applied to -trivial, thanks!

/mjt