All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] env_onenand compiler warning
@ 2009-07-19  6:47 Dirk Behme
  2009-07-19 15:13 ` [U-Boot] [PATCH] env_onenand: fix compiler warning for error message Alessandro Rubini
  2009-07-20  0:53 ` [U-Boot] env_onenand compiler warning Kyungmin Park
  0 siblings, 2 replies; 4+ messages in thread
From: Dirk Behme @ 2009-07-19  6:47 UTC (permalink / raw)
  To: u-boot


Testing recent mainline git head for omap3_evm_config I get compiler 
warning

env_onenand.c: In function 'saveenv':
env_onenand.c:104: warning: format '%08lx' expects type 'long unsigned 
int', but argument 2 has type 'loff_t'

Is there already a fix available?

Thanks

Dirk

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

* [U-Boot] [PATCH] env_onenand: fix compiler warning for error message
  2009-07-19  6:47 [U-Boot] env_onenand compiler warning Dirk Behme
@ 2009-07-19 15:13 ` Alessandro Rubini
  2009-07-19 17:17   ` Wolfgang Denk
  2009-07-20  0:53 ` [U-Boot] env_onenand compiler warning Kyungmin Park
  1 sibling, 1 reply; 4+ messages in thread
From: Alessandro Rubini @ 2009-07-19 15:13 UTC (permalink / raw)
  To: u-boot

From: Alessandro Rubini <rubini@gnudd.com>

Since env_addr is a loff_t (long long), "%08lx" is not a good format;
this uses "%08llx" (not "%016llx"), to get 8 or more hex digits.  I
tnknk padding to 8 digits makes things more readable for "small"
numbers, and the unlikely values over 4GB are reported correctly
anyways.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
---

I found this during "./MAKEALL arm", and it affects my nhk8815 as
well.  The warning was already reported today by Dirk Behme, thus this is
reply to his message.

 common/env_onenand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/env_onenand.c b/common/env_onenand.c
index 476fdbc..0b03537 100644
--- a/common/env_onenand.c
+++ b/common/env_onenand.c
@@ -101,7 +101,7 @@ int saveenv(void)
 	instr.addr = env_addr;
 	instr.mtd = mtd;
 	if (mtd->erase(mtd, &instr)) {
-		printf("OneNAND: erase failed at 0x%08lx\n", env_addr);
+		printf("OneNAND: erase failed at 0x%08llx\n", (u64)env_addr);
 		return 1;
 	}
 
-- 
1.6.0.2

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

* [U-Boot] [PATCH] env_onenand: fix compiler warning for error message
  2009-07-19 15:13 ` [U-Boot] [PATCH] env_onenand: fix compiler warning for error message Alessandro Rubini
@ 2009-07-19 17:17   ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2009-07-19 17:17 UTC (permalink / raw)
  To: u-boot

Dear Alessandro Rubini,

In message <20090719151345.GA17567@mail.gnudd.com> you wrote:
> From: Alessandro Rubini <rubini@gnudd.com>
> 
> Since env_addr is a loff_t (long long), "%08lx" is not a good format;
> this uses "%08llx" (not "%016llx"), to get 8 or more hex digits.  I
> tnknk padding to 8 digits makes things more readable for "small"
> numbers, and the unlikely values over 4GB are reported correctly
> anyways.

But %llx needs CONFIG_SYS_64BIT_VSPRINTF - are we sure that this is
#define'd on all boards that use onenand?

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
"In the face of entropy and nothingness, you kind of have to  pretend
it's  not  there  if  you  want  to  keep writing good code."
- Karl Lehenbauer

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

* [U-Boot] env_onenand compiler warning
  2009-07-19  6:47 [U-Boot] env_onenand compiler warning Dirk Behme
  2009-07-19 15:13 ` [U-Boot] [PATCH] env_onenand: fix compiler warning for error message Alessandro Rubini
@ 2009-07-20  0:53 ` Kyungmin Park
  1 sibling, 0 replies; 4+ messages in thread
From: Kyungmin Park @ 2009-07-20  0:53 UTC (permalink / raw)
  To: u-boot

Hi,

Thank you for pointing compiler warning.

I post the patch.

Thank you,
Kyungmin Park

On Sun, Jul 19, 2009 at 3:47 PM, Dirk Behme<dirk.behme@googlemail.com> wrote:
>
> Testing recent mainline git head for omap3_evm_config I get compiler
> warning
>
> env_onenand.c: In function 'saveenv':
> env_onenand.c:104: warning: format '%08lx' expects type 'long unsigned
> int', but argument 2 has type 'loff_t'
>
> Is there already a fix available?
>
> Thanks
>
> Dirk
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

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

end of thread, other threads:[~2009-07-20  0:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-19  6:47 [U-Boot] env_onenand compiler warning Dirk Behme
2009-07-19 15:13 ` [U-Boot] [PATCH] env_onenand: fix compiler warning for error message Alessandro Rubini
2009-07-19 17:17   ` Wolfgang Denk
2009-07-20  0:53 ` [U-Boot] env_onenand compiler warning Kyungmin Park

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.