Skip to contentSkip to conversation

drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning

PATCH New Kumar Gala 3 participants 6 messages Nov 23, 2011 – Nov 27, 2011

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning

Fix:

x86emu/ops2.c: In function 'x86emuOp2_set_byte':
x86emu/ops2.c:171:11: warning: variable 'name' set but not used [-Wunused-but-set-variable]

---
 drivers/bios_emulator/x86emu/ops2.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/bios_emulator/x86emu/ops2.c +2 -1
index 937bf4c..59dbb42 100644
@@ -42,6 +42,7 @@
 ****************************************************************************/
 
 #include <common.h>
+#include <linux/compiler.h>
 #include "x86emu/x86emui.h"
 
 /*----------------------------- Implementation ----------------------------*/
@@ -168,7 +169,7 @@ void x86emuOp2_set_byte(u8 op2)
     int mod, rl, rh;
     uint destoffset;
     u8	*destreg;
-    char *name = 0;
+    __maybe_unused char *name = 0;
     int cond = 0;
 
     START_OF_INSTR();
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/1 drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning

Quoted 29 lines

Fix:

x86emu/ops2.c: In function 'x86emuOp2_set_byte':
x86emu/ops2.c:171:11: warning: variable 'name' set but not used [-Wunused-but-set-variable]

---
 drivers/bios_emulator/x86emu/ops2.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/bios_emulator/x86emu/ops2.c index 937bf4c..59dbb42 100644

drivers/bios_emulator/x86emu/ops2.c +1 -0
@@ -42,6 +42,7 @@
 **************************************************************************
 **/
 
 #include <common.h>
+#include <linux/compiler.h>
 #include "x86emu/x86emui.h"
 

/*----------------------------- Implementation
----------------------------*/ @@ -168,7 +169,7 @@ void x86emuOp2_set_byte(u8 op2)

     int mod, rl, rh;
     uint destoffset;
     u8	*destreg;

drivers/bios_emulator/x86emu/ops2.c void x86emuOp2_set_byte(u8 op2) · line 172

Quoted 2 lines
drivers/bios_emulator/x86emu/ops2.c +1 -1
-    char *name = 0;
+    __maybe_unused char *name = 0;

I don't like this __maybe_unused stuff, it seems like you're hiding possible errors.

Quoted 3 lines
     int cond = 0;

     START_OF_INSTR();
author
#2 lore raw

PATCH 1/1 drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning

Quoted 23 lines · Marek Vasut
Quoted 23 lines

Fix:

x86emu/ops2.c: In function 'x86emuOp2_set_byte':
x86emu/ops2.c:171:11: warning: variable 'name' set but not used [-Wunused-but-set-variable]

---
drivers/bios_emulator/x86emu/ops2.c | 3 ++-

1 files changed, 2 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/bios_emulator/x86emu/ops2.c index 937bf4c..59dbb42 100644

drivers/bios_emulator/x86emu/ops2.c +1 -0
@@ -42,6 +42,7 @@
 **************************************************************************
 **/
 
 #include <common.h>
+#include <linux/compiler.h>
 #include "x86emu/x86emui.h"
 
Quoted 11 lines

drivers/bios_emulator/x86emu/ops2.c void x86emuOp2_set_byte(u8 op2) · line 172

Quoted 8 lines

/*----------------------------- Implementation ----------------------------*/ @@ -168,7 +169,7 @@ void x86emuOp2_set_byte(u8 op2)

    int mod, rl, rh;
    uint destoffset;
    u8	*destreg;
drivers/bios_emulator/x86emu/ops2.c +1 -1
-    char *name = 0;
+    __maybe_unused char *name = 0;

I don't like this __maybe_unused stuff, it seems like you're hiding possible errors.

welcome for ideas on a better fix.

- k

#3 lore raw

PATCH 1/1 drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 6 lines · In message <[email protected]> you wrote:

drivers/bios_emulator/x86emu/ops2.c void x86emuOp2_set_byte(u8 op2) · line 172

Quoted 3 lines
drivers/bios_emulator/x86emu/ops2.c +1 -1
-    char *name = 0;
+    __maybe_unused char *name = 0;

I don't like this __maybe_unused stuff, it seems like you're hiding possible errors.

I don't like it either, but there are cases where this is the cheapest way to get the code clean again, and still working.

If you have a better proposal to make this file compile clean, without using __maybe_unused, then please post your patch.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
How come everyone's going so slow if it's called rush hour?
#4 lore raw

PATCH 1/1 drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning

Hi,

Quoted 6 lines

Dear Marek Vasut,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 2 lines
drivers/bios_emulator/x86emu/ops2.c +1 -1
-    char *name = 0;
+    __maybe_unused char *name = 0;
Quoted 9 lines
Quoted 2 lines

I don't like this __maybe_unused stuff, it seems like you're hiding possible errors.

I don't like it either, but there are cases where this is the cheapest way to get the code clean again, and still working.

If you have a better proposal to make this file compile clean, without using __maybe_unused, then please post your patch.

Honestly, not right now. I'd prefer to work on other stuff that's slightly more important (mx51usb, bootz ... pile of other stuff). This patch is of moderate importance to me (which means I'll think about it when I'm idle).

Anyway, from now on, I'd like to try picking up gcc4.6 fixes (as I started whole this machinery with the debug() macro changes) and start pushing it through - staging. Are you against it?

M

#5 lore raw

PATCH 1/1 drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning

In reply to Kumar Gala

Dear Kumar Gala,

Quoted 9 lines · In message <[email protected]> you…

Fix:

x86emu/ops2.c: In function 'x86emuOp2_set_byte':
x86emu/ops2.c:171:11: warning: variable 'name' set but not used [-Wunused-but-set-variable]

---
 drivers/bios_emulator/x86emu/ops2.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 10 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Scotty: Captain, we din' can reference it!
Kirk:   Analysis, Mr. Spock?
Spock:  Captain, it doesn't appear in the symbol table.
Kirk:   Then it's of external origin?
Spock:  Affirmative.
Kirk:   Mr. Sulu, go to pass two.
Sulu:   Aye aye, sir, going to pass two.