public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: "Simon Glass" <sjg@chromium.org>,
	"Alexandru Gagniuc" <mr.nuke.me@gmail.com>,
	"Thomas Hebb" <tommyhebb@gmail.com>,
	"Yann Dirson" <yann@blade-group.com>,
	"Joel Stanley" <joel@jms.id.au>,
	u-boot@lists.denx.de, "Milan P . Stanić" <mps@arvanta.net>
Subject: Re: [PATCH 1/1] mkimage: struct stat.st_size may not be long
Date: Mon, 24 Jan 2022 11:53:35 -0500	[thread overview]
Message-ID: <20220124165335.GB7515@bill-the-cat> (raw)
In-Reply-To: <20220115191256.118920-1-heinrich.schuchardt@canonical.com>

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

On Sat, Jan 15, 2022 at 08:12:56PM +0100, Heinrich Schuchardt wrote:

> The component st_size of struct stat is of type off_t. Depending on the
> system printing it it with %ld leads to a warning:
> 
> tools/mkimage.c:438:54: warning: format '%ld' expects argument of type
> 'long int', but argument 5 has type
> 'off_t' {aka 'long long int'} [-Wformat=]
>   438 |     "%s: Bad size: \"%s\" is not valid image: size %ld < %u\n",
>       |                                                    ~~^
>       |                                                      |
>       |                                                      long int
>       |                                                    %lld
> 
> When comparing an off_t value to a 32bit integer we should not convert to
> uint32_t but to off_t which may be wider.
> 
> Reported-by: Milan P. Stanić <mps@arvanta.net>
> Fixes: 331f0800f1a3 ("mkimage: allow -l to work on block devices on Linux")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

      parent reply	other threads:[~2022-01-24 16:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-15 19:12 [PATCH 1/1] mkimage: struct stat.st_size may not be long Heinrich Schuchardt
2022-01-17 20:20 ` Milan P. Stanić
2022-01-17 20:35   ` Mark Kettenis
2022-01-24 16:53 ` Tom Rini [this message]

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=20220124165335.GB7515@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=joel@jms.id.au \
    --cc=mps@arvanta.net \
    --cc=mr.nuke.me@gmail.com \
    --cc=sjg@chromium.org \
    --cc=tommyhebb@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=yann@blade-group.com \
    /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