public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/8]: Use do_div from div64.h for vsprintf
Date: Wed, 22 Jul 2009 07:13:21 +0200	[thread overview]
Message-ID: <200907220713.21782.sr@denx.de> (raw)
In-Reply-To: <4A6609A1.1010201@googlemail.com>

Hi Dirk,

On Tuesday 21 July 2009 20:32:01 Dirk Behme wrote:
> 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.

I have no "better" idea as well. It's still an improvement to the current 
implementation. So I suggest you prepare a patch (IIRC, Simon is on vacation 
right now).

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2009-07-22  5:13 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
2009-07-22  5:13         ` Stefan Roese [this message]
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=200907220713.21782.sr@denx.de \
    --to=sr@denx.de \
    --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