From: Dirk Behme <dirk.behme@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/8]: Use do_div from div64.h for vsprintf
Date: Tue, 21 Jul 2009 20:32:01 +0200 [thread overview]
Message-ID: <4A6609A1.1010201@googlemail.com> (raw)
In-Reply-To: <20090720215922.A516C832E416@gemini.denx.de>
Wolfgang Denk wrote:
> Dear Simon Kagstrom,
>
> In message <20090720214252.B0B6E832E416@gemini.denx.de> I wrote:
>> Dear Simon Kagstrom,
>>
>> In message <20090707155927.78e75333@marrow.netinsight.se> you wrote:
>>> Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
>>> ---
>>> lib_generic/vsprintf.c | 7 +------
>>> 1 files changed, 1 insertions(+), 6 deletions(-)
>> Applied, thanks.
>
> Sorry, I had to back out your patch. as it is causing compile problems:
>
> -> ./MAKEALL voiceblue
> Configuring for voiceblue board...
> vsprintf.c: In function 'put_dec':
> vsprintf.c:237: warning: comparison of distinct pointer types lacks a cast
> vsprintf.c:237: warning: right shift count >= width of type
> vsprintf.c:237: warning: passing argument 1 of '__div64_32' from incompatible pointer type
> text data bss dec hex filename
> 142099 5196 23304 170599 29a67 ./u-boot
>
> Please fix and resubmit.
:(
This is because do_div() in div64.h only likes a 64bit value as first
parameter.
So something like
--- a/lib_generic/vsprintf.c
+++ b/lib_generic/vsprintf.c
@@ -22,18 +22,19 @@ extern int do_reset (cmd_tbl_t *cmdtp, i
#endif
#ifdef CONFIG_SYS_64BIT_VSPRINTF
+#include <div64.h>
# define NUM_TYPE long long
#else
# define NUM_TYPE long
-#endif
-#define noinline __attribute__((noinline))
-
#define do_div(n, base) ({ \
unsigned int __res; \
__res = ((unsigned NUM_TYPE) n) % base; \
n = ((unsigned NUM_TYPE) n) / base; \
__res; \
})
+#endif
+#define noinline __attribute__((noinline))
+
would do the trick. I don't know any clean way how to do this, though.
Best regards
Dirk
next prev parent reply other threads:[~2009-07-21 18:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-07 13:55 [U-Boot] [PATCH 0/8]: Fixes for ubifs build on ARM Simon Kagstrom
2009-07-07 13:56 ` [U-Boot] [PATCH 1/8]: Move __set/clear_bit from ubifs.h to bitops.h Simon Kagstrom
2009-07-09 8:31 ` Stefan Roese
2009-07-19 9:54 ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-07 13:57 ` [U-Boot] [PATCH 2/8]: Define ffs/fls for all architectures Simon Kagstrom
2009-07-20 21:37 ` Wolfgang Denk
2009-07-07 13:58 ` [U-Boot] [PATCH 3/8]: Define test_and_set/clear_bit for ARM Simon Kagstrom
2009-07-19 9:47 ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-19 12:51 ` Wolfgang Denk
2009-08-17 14:43 ` Simon Kagstrom
2009-07-07 13:58 ` [U-Boot] [PATCH 4/8]: Add unaligned.h for arm Simon Kagstrom
2009-07-09 8:42 ` Stefan Roese
2009-07-20 21:39 ` Wolfgang Denk
2009-07-07 13:59 ` [U-Boot] [PATCH 5/8]: Use do_div from div64.h for vsprintf Simon Kagstrom
2009-07-09 8:38 ` Stefan Roese
2009-07-19 6:48 ` Dirk Behme
2009-07-20 21:42 ` Wolfgang Denk
2009-07-20 21:59 ` Wolfgang Denk
2009-07-21 18:32 ` Dirk Behme [this message]
2009-07-22 5:13 ` Stefan Roese
2009-07-07 13:59 ` [U-Boot] [PATCH 6/8]: Use lldiv to avoid references to __udvidi3 on (at least) ARM Simon Kagstrom
2009-07-07 14:20 ` Stefan Roese
2009-07-07 14:29 ` Simon Kagstrom
2009-07-07 14:00 ` [U-Boot] [PATCH 7/8]: Handle VID header offset in ubi part command Simon Kagstrom
2009-07-07 14:46 ` Stefan Roese
2009-07-07 14:59 ` Simon Kagstrom
2009-07-09 7:58 ` Stefan Roese
2009-07-07 14:01 ` [U-Boot] [PATCH 8/8]: Command improvements for ubifs Simon Kagstrom
2009-07-08 9:37 ` Stefan Roese
2009-07-09 11:07 ` Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A6609A1.1010201@googlemail.com \
--to=dirk.behme@googlemail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox