selftests: bpf: xskxceiver: ksft_print_msg: fix format type error
authorAnders Roxell <anders.roxell@linaro.org>
Thu, 9 Nov 2023 17:43:28 +0000 (18:43 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 10 Nov 2023 03:18:12 +0000 (19:18 -0800)
commitfe69a1b1b6ed9ffc2c578c63f526026a8ab74f0c
tree2447ed60aede14e0b8f34f398764b6d86f5c0555
parent89cdf9d556016a54ff6ddd62324aa5ec790c05cc
selftests: bpf: xskxceiver: ksft_print_msg: fix format type error

Crossbuilding selftests/bpf for architecture arm64, format specifies
type error show up like.

xskxceiver.c:912:34: error: format specifies type 'int' but the argument
has type '__u64' (aka 'unsigned long long') [-Werror,-Wformat]
 ksft_print_msg("[%s] expected meta_count [%d], got meta_count [%d]\n",
                                                                ~~
                                                                %llu
                __func__, pkt->pkt_nb, meta->count);
                                       ^~~~~~~~~~~
xskxceiver.c:929:55: error: format specifies type 'unsigned long long' but
 the argument has type 'u64' (aka 'unsigned long') [-Werror,-Wformat]
 ksft_print_msg("Frag invalid addr: %llx len: %u\n", addr, len);
                                    ~~~~             ^~~~

Fixing the issues by casting to (unsigned long long) and changing the
specifiers to be %llu from %d and %u, since with u64s it might be %llx
or %lx, depending on architecture.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://lore.kernel.org/r/20231109174328.1774571-1-anders.roxell@linaro.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/xskxceiver.c