All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] Remove <inttypes.h> includes and PRI* usages in printf() entirely
Date: Tue, 7 Aug 2018 11:11:43 +0900	[thread overview]
Message-ID: <CAK7LNATXvdPec3fZocD7hs_-mn+bd=pOufYo5N9S6+awLDYKjg@mail.gmail.com> (raw)
In-Reply-To: <CAHp75Vfb=HAgH344Vqq0-7+RxfVC0o1fmCRHJdbNGO1KdXc4BA@mail.gmail.com>

2018-08-06 22:20 GMT+09:00 Andy Shevchenko <andy.shevchenko@gmail.com>:
> On Mon, Aug 6, 2018 at 2:47 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>
>> The use of PRI* makes the code super-ugly.  You can simply use
>> "l" for printing uintptr_t, "ll" for u64, and no modifier for u32.
>
> This is not always the case. I dunno what exact usage of PRIx in
> U-Boot, but this is correct way for some size-variable types.
> So, if U-Boot is known of not using something like off_t, then we are fine.

U-Boot uses off_t.

All architectures use 'long' for off_t.
It is safe to use 'l' modifier for printing off_t variables.



As for Linux, only i386 use 'long long' for off_t, right?
To sum up,

  i386:                       long long   (64bit)
  other 32-bit architectures  long        (32bit)
  64bit architectures:        long        (64bit)


off_t is not even fixed-width type.

The weirdness of __kernel_long_t is interesting,
but unrelated to this patch.




> In any case the commit message should better justify this part (PRIu64
> is specified in standard).
>


-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2018-08-07  2:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-06 11:47 [U-Boot] [PATCH 1/3] Remove CONFIG_USE_STDINT Masahiro Yamada
2018-08-06 11:47 ` [U-Boot] [PATCH 2/3] arch: types.h: factor out fixed width typedefs to int-ll64.h Masahiro Yamada
2018-09-11 12:25   ` [U-Boot] [U-Boot, " Tom Rini
2018-08-06 11:47 ` [U-Boot] [PATCH 3/3] Remove <inttypes.h> includes and PRI* usages in printf() entirely Masahiro Yamada
2018-08-06 13:20   ` Andy Shevchenko
2018-08-07  2:11     ` Masahiro Yamada [this message]
2018-09-11 12:25   ` [U-Boot] [U-Boot, " Tom Rini
2018-09-11 12:25 ` [U-Boot] [U-Boot,1/3] Remove CONFIG_USE_STDINT Tom Rini

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='CAK7LNATXvdPec3fZocD7hs_-mn+bd=pOufYo5N9S6+awLDYKjg@mail.gmail.com' \
    --to=yamada.masahiro@socionext.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 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.