From 00c37199d7a784b627a9017c4533a3ca240b9c6d Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Mon, 17 Apr 2023 14:50:00 +0200 Subject: misc: make format_hexdump length u32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit format_hexdump currently requires the length parameter to be uword (64-bits) hence all callers must make sure to cast the length to uword. Use u32 instead to benefit from C automatic integer promotion: any length smaller or equal to u32 will be promoted to int fitting in u32). Only callers using a length of u64 needs to downcast. It also makes it similar to other variants. Type: fix Change-Id: I09b52fdde3970cec0be4150a29126ff63106c75b Signed-off-by: Benoît Ganne --- src/vppinfra/std-formats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vppinfra/std-formats.c') diff --git a/src/vppinfra/std-formats.c b/src/vppinfra/std-formats.c index 7a51a531d31..cb2872ad24b 100644 --- a/src/vppinfra/std-formats.c +++ b/src/vppinfra/std-formats.c @@ -414,7 +414,7 @@ __clib_export u8 * format_hexdump (u8 * s, va_list * args) { u8 *data = va_arg (*args, u8 *); - uword len = va_arg (*args, uword); + u32 len = va_arg (*args, u32); int i, index = 0; const int line_len = 16; u8 *line_hex = 0; -- cgit 1.2.3-korg