public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning
@ 2011-11-23 16:31 Kumar Gala
  2011-11-24 17:14 ` Marek Vasut
  2011-11-27 14:45 ` Wolfgang Denk
  0 siblings, 2 replies; 6+ messages in thread
From: Kumar Gala @ 2011-11-23 16:31 UTC (permalink / raw)
  To: u-boot

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]

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 drivers/bios_emulator/x86emu/ops2.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/bios_emulator/x86emu/ops2.c b/drivers/bios_emulator/x86emu/ops2.c
index 937bf4c..59dbb42 100644
--- a/drivers/bios_emulator/x86emu/ops2.c
+++ b/drivers/bios_emulator/x86emu/ops2.c
@@ -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();
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning
  2011-11-23 16:31 [U-Boot] [PATCH] drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning Kumar Gala
@ 2011-11-24 17:14 ` Marek Vasut
  2011-11-24 19:11   ` Kumar Gala
  2011-11-24 20:48   ` Wolfgang Denk
  2011-11-27 14:45 ` Wolfgang Denk
  1 sibling, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2011-11-24 17:14 UTC (permalink / raw)
  To: u-boot

> 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]
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
>  drivers/bios_emulator/x86emu/ops2.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/bios_emulator/x86emu/ops2.c
> b/drivers/bios_emulator/x86emu/ops2.c index 937bf4c..59dbb42 100644
> --- a/drivers/bios_emulator/x86emu/ops2.c
> +++ b/drivers/bios_emulator/x86emu/ops2.c
> @@ -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;

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

>      int cond = 0;
> 
>      START_OF_INSTR();

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning
  2011-11-24 17:14 ` Marek Vasut
@ 2011-11-24 19:11   ` Kumar Gala
  2011-11-24 20:48   ` Wolfgang Denk
  1 sibling, 0 replies; 6+ messages in thread
From: Kumar Gala @ 2011-11-24 19:11 UTC (permalink / raw)
  To: u-boot


On Nov 24, 2011, at 11:14 AM, Marek Vasut wrote:

>> 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]
>> 
>> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>> ---
>> drivers/bios_emulator/x86emu/ops2.c |    3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>> 
>> diff --git a/drivers/bios_emulator/x86emu/ops2.c
>> b/drivers/bios_emulator/x86emu/ops2.c index 937bf4c..59dbb42 100644
>> --- a/drivers/bios_emulator/x86emu/ops2.c
>> +++ b/drivers/bios_emulator/x86emu/ops2.c
>> @@ -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;
> 
> I don't like this __maybe_unused stuff, it seems like you're hiding possible 
> errors.

welcome for ideas on a better fix.

- k

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning
  2011-11-24 17:14 ` Marek Vasut
  2011-11-24 19:11   ` Kumar Gala
@ 2011-11-24 20:48   ` Wolfgang Denk
  2011-11-24 22:31     ` Marek Vasut
  1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2011-11-24 20:48 UTC (permalink / raw)
  To: u-boot

Dear Marek Vasut,

In message <201111241814.34611.marek.vasut@gmail.com> you wrote:
>
> > -    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

-- 
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?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning
  2011-11-24 20:48   ` Wolfgang Denk
@ 2011-11-24 22:31     ` Marek Vasut
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2011-11-24 22:31 UTC (permalink / raw)
  To: u-boot

Hi,

> Dear Marek Vasut,
> 
> In message <201111241814.34611.marek.vasut@gmail.com> you wrote:
> > > -    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.
> 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning
  2011-11-23 16:31 [U-Boot] [PATCH] drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning Kumar Gala
  2011-11-24 17:14 ` Marek Vasut
@ 2011-11-27 14:45 ` Wolfgang Denk
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2011-11-27 14:45 UTC (permalink / raw)
  To: u-boot

Dear Kumar Gala,

In message <1322065864-5424-1-git-send-email-galak@kernel.crashing.org> you wrote:
> 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]
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
>  drivers/bios_emulator/x86emu/ops2.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-27 14:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 16:31 [U-Boot] [PATCH] drivers/bios_emulator/x86emu/ops2.c: Fix GCC 4.6 build warning Kumar Gala
2011-11-24 17:14 ` Marek Vasut
2011-11-24 19:11   ` Kumar Gala
2011-11-24 20:48   ` Wolfgang Denk
2011-11-24 22:31     ` Marek Vasut
2011-11-27 14:45 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox