From 92a27329d529757677d7eda5a04cf4a366a17495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Mon, 23 May 2016 19:24:35 +0200 Subject: gard: fix compile error on ARM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gard can be used on the BMC to query garded records, but currently compile fails with : cc -O2 -Wall -Werror -I. -c gard.c -o gard.o gard.c: In function 'do_clear_i': gard.c:421:12: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' [-Werror=format] gard.c: In function 'check_gard_partition': gard.c:489:36: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'unsigned int' [-Werror=format] This patches provides a fix compatible with x86, armel, ppc64. Signed-off-by: Cédric Le Goater Signed-off-by: Stewart Smith --- external/gard/gard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external/gard/gard.c b/external/gard/gard.c index 2215864..b2e814e 100644 --- a/external/gard/gard.c +++ b/external/gard/gard.c @@ -417,8 +417,8 @@ static int do_clear_i(struct gard_ctx *ctx, int pos, struct gard_record *gard, v rc = blocklevel_smart_write(ctx->bl, buf_pos - sizeof_gard(ctx), buf, buf_len); free(buf); if (rc) { - fprintf(stderr, "Couldn't write to flash at 0x%08lx for len 0x%08x\n", - buf_pos - sizeof_gard(ctx), buf_len); + fprintf(stderr, "Couldn't write to flash at 0x%08x for len 0x%08x\n", + buf_pos - (int) sizeof_gard(ctx), buf_len); return rc; } } @@ -485,7 +485,7 @@ int check_gard_partition(struct gard_ctx *ctx) if (ctx->gard_data_len == 0 || ctx->gard_data_len % sizeof(struct gard_record) != 0) /* Just warn for now */ fprintf(stderr, "The %s partition doesn't appear to be an exact multiple of" - "gard records in size: %lu vs %u (or partition is zero in length)\n", + "gard records in size: %zd vs %u (or partition is zero in length)\n", FLASH_GARD_PART, sizeof(struct gard_record), ctx->gard_data_len); /* -- cgit v1.1