From b34b27edaea649b22d17c9be8d8d9f0b0b077471 Mon Sep 17 00:00:00 2001 From: Ulrich Ölmann Date: Fri, 8 Feb 2019 08:15:20 +0100 Subject: common: state: fix compiler warnings about wrong type conversion in messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To harmonize the common codebase this ports the remaining hunks of the following dt-utils commit, as the residual hunks have independently already been done before in barebox commit 1afbf6b5680e ("state: fix compile warnings for dev_err expansion"): | commit 9f1db73234b40f4ea071421e8179065df16211ec | Author: Philipp Rosenberger | Date: Thu Oct 18 09:17:23 2018 +0200 | | Fix compiler warnings about wrong type conversion in messages. | | These warning were observed with gcc-6.3 on x86-64. | | Signed-off-by: Philipp Rosenberger | Signed-off-by: Sascha Hauer Signed-off-by: Ulrich Ölmann Signed-off-by: Sascha Hauer --- common/state/backend_bucket_circular.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'common') diff --git a/common/state/backend_bucket_circular.c b/common/state/backend_bucket_circular.c index 4b71d8751d..5a85650f40 100644 --- a/common/state/backend_bucket_circular.c +++ b/common/state/backend_bucket_circular.c @@ -165,13 +165,13 @@ static int state_mtd_peb_read(struct state_backend_storage_bucket_circular *circ return ret; } - dev_dbg(circ->dev, "Read state from %ld length %zd\n", offset, + dev_dbg(circ->dev, "Read state from %ld length %d\n", offset, len); ret = read_full(circ->fd, buf, len); if (ret < 0) { - dev_err(circ->dev, "Failed to read circular storage len %zd, %d\n", + dev_err(circ->dev, "Failed to read circular storage len %d, %d\n", len, ret); free(buf); } @@ -196,7 +196,7 @@ static int state_mtd_peb_write(struct state_backend_storage_bucket_circular *cir ret = write_full(circ->fd, buf, len); if (ret < 0) { - dev_err(circ->dev, "Failed to write circular to %ld length %zd, %d\n", + dev_err(circ->dev, "Failed to write circular to %ld length %d, %d\n", offset, len, ret); return ret; } @@ -207,7 +207,7 @@ static int state_mtd_peb_write(struct state_backend_storage_bucket_circular *cir */ flush(circ->fd); - dev_dbg(circ->dev, "Written state to offset %ld length %zd data length %zd\n", + dev_dbg(circ->dev, "Written state to offset %ld length %d data length %d\n", offset, len, len); return 0; @@ -298,7 +298,7 @@ static int state_backend_bucket_circular_write(struct state_backend_storage_buck void *write_buf; if (written_length > circ->max_size) { - dev_err(circ->dev, "Error, state data too big to be written, to write: %zd, writesize: %zd, length: %zd, available: %zd\n", + dev_err(circ->dev, "Error, state data too big to be written, to write: %d, writesize: %zd, length: %zd, available: %zd\n", written_length, circ->writesize, len, circ->max_size); return -E2BIG; } @@ -345,12 +345,12 @@ static int state_backend_bucket_circular_write(struct state_backend_storage_buck ret = state_mtd_peb_write(circ, write_buf, offset, written_length); if (ret < 0 && ret != -EUCLEAN) { - dev_err(circ->dev, "Failed to write circular to %ld length %zd, %d\n", + dev_err(circ->dev, "Failed to write circular to %ld length %d, %d\n", offset, written_length, ret); goto out_free; } - dev_dbg(circ->dev, "Written state to PEB %u offset %ld length %zd data length %zd\n", + dev_dbg(circ->dev, "Written state to PEB %u offset %ld length %d data length %zd\n", circ->eraseblock, offset, written_length, len); out_free: -- cgit v1.2.3