From: Pavel Machek <pavel@ucw.cz>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] disk/part.c: use unsigned format when printing capacity
Date: Sun, 14 Dec 2014 18:56:48 +0100 [thread overview]
Message-ID: <20141214175648.GA10222@amd> (raw)
In-Reply-To: <20141208000411.GA10845@makrotopia.org>
I'm afraid I'm not the right contact to merge the patch. It should
probably go to Tom Rini and u-boot list. (I put them in Cc).
Pavel
On Mon 2014-12-08 01:04:16, Daniel Golle wrote:
> Large disks otherwise produce highly unplausible output such as
> Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)
>
> As supposedly all size-related decimals are unsigned, use unsigned
> format in printf statement, resulting in a correct capacity being
> displayed:
> Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> disk/part.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/disk/part.c b/disk/part.c
> index 43485c9..7c67ea6 100644
> --- a/disk/part.c
> +++ b/disk/part.c
> @@ -229,13 +229,13 @@ void dev_print (block_dev_desc_t *dev_desc)
> printf (" Supports 48-bit addressing\n");
> #endif
> #if defined(CONFIG_SYS_64BIT_LBA)
> - printf (" Capacity: %ld.%ld MB = %ld.%ld GB (%Ld x %ld)\n",
> + printf (" Capacity: %lu.%lu MB = %lu.%lu GB (%Lu x %lu)\n",
> mb_quot, mb_rem,
> gb_quot, gb_rem,
> lba,
> dev_desc->blksz);
> #else
> - printf (" Capacity: %ld.%ld MB = %ld.%ld GB (%ld x %ld)\n",
> + printf (" Capacity: %lu.%lu MB = %lu.%lu GB (%lu x %lu)\n",
> mb_quot, mb_rem,
> gb_quot, gb_rem,
> (ulong)lba,
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
parent reply other threads:[~2014-12-14 17:56 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20141208000411.GA10845@makrotopia.org>]
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=20141214175648.GA10222@amd \
--to=pavel@ucw.cz \
--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 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.