summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2017-07-28 18:47:04 +0000
committerLuiz Souza <luiz@netgate.com>2018-02-24 03:14:54 -0300
commit45abe21e5c144286dde6a6648e4ac96f37b9ff2a (patch)
tree5d4aa955f7a9895b575c1e237639e50318622c02
parente121cea29ef9da649959dcfcfd6e42b212b04136 (diff)
downloadFreeBSD-src-45abe21e5c144286dde6a6648e4ac96f37b9ff2a.zip
FreeBSD-src-45abe21e5c144286dde6a6648e4ac96f37b9ff2a.tar.gz
MFC r321306:
Fix printf format warning in iflib.c Clang 5.0.0 got better warnings about printf format strings using %zd, and this leads to the following -Werror warning on e.g. arm: sys/net/iflib.c:1517:8: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat] sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize); ^~~~~~~~~~~~~~~~~~~~ sys/net/iflib.c:1517:41: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat] sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize); ^~~~~~~~~~~~~~~~~~~~~~~ Fix this by casting bus_size_t arguments to uintmax_t, and using %ju instead. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D11679 (cherry picked from commit 58bfec3f9f30e99a0addd75812351da4d35fd9ba)
-rw-r--r--sys/net/iflib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index 21d5095..00f29e0 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -1262,8 +1262,8 @@ iflib_txsd_alloc(iflib_txq_t txq)
NULL, /* lockfuncarg */
&txq->ift_desc_tag))) {
device_printf(dev,"Unable to allocate TX DMA tag: %d\n", err);
- device_printf(dev,"maxsize: %zd nsegments: %d maxsegsize: %zd\n",
- sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
+ device_printf(dev,"maxsize: %ju nsegments: %d maxsegsize: %ju\n",
+ (uintmax_t)sctx->isc_tx_maxsize, nsegments, (uintmax_t)sctx->isc_tx_maxsegsize);
goto fail;
}
#ifdef IFLIB_DIAGNOSTICS
OpenPOWER on IntegriCloud