[U-Boot] [PATCH v2] common: fix compiler warning on wrong printf format
Vasili Galka
vvv444 at gmail.com
Thu Aug 28 16:17:24 CEST 2014
On Thu, Aug 28, 2014 at 4:15 PM, Alexey Brodkin <Alexey.Brodkin at synopsys.com
> wrote:
> From: Alexey Brodkin <Alexey.Brodkin at synopsys.com>
>
> bounce_buffer->len_aligned is of type "size_t" so use "%zd".
>
> this fixes following warning:
> --->---
> common/bouncebuf.c: In function "addr_aligned":
> common/bouncebuf.c:26:3: warning: format "%d" expects argument of type
> "int", but argument 2 has type "size_t" [-Wformat=]
> debug("Unaligned buffer length %d\n", /*(int)*/state->len);
> ^
> --->---
>
> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> Cc: Vasili Galka <vvv444 at gmail.com>
> Cc: Tom Rini <trini at ti.com>
> cc: Chris Packham <judge.packham at gmail.com>
> ---
> Compared to v1 proper format (%zd) is used in string instead of type
> casting.
> ---
> common/bouncebuf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/bouncebuf.c b/common/bouncebuf.c
> index 9eece6d..8dde8fd 100644
> --- a/common/bouncebuf.c
> +++ b/common/bouncebuf.c
> @@ -23,7 +23,7 @@ static int addr_aligned(struct bounce_buffer *state)
>
> /* Check if length is aligned */
> if (state->len != state->len_aligned) {
> - debug("Unaligned buffer length %d\n", state->len);
> + debug("Unaligned buffer length %zd\n", state->len);
> return 0;
> }
>
> --
> 1.9.3
>
>
Hmm, why not just use my original patch which included exactly this?
http://patchwork.ozlabs.org/patch/383041/
More information about the U-Boot
mailing list