mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-04 17:19:43 +00:00
use print_{,h}hu instead of print_uint when format specifier is %{,h}hu
in this way, a useless cast to unsigned int is avoided in bpf_print_ops() and print_tunnel(). Tested with: # ./tdc.py -c bpf Suggested-by: Stephen Hemminger <stephen@networkplumber.org> Cc: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
parent
05bc89e95e
commit
ca81444303
@ -237,9 +237,9 @@ static void print_tunnel(const struct l2tp_data *data)
|
||||
print_string(PRINT_FP, NULL,
|
||||
" UDP source / dest ports:", NULL);
|
||||
|
||||
print_uint(PRINT_ANY, "local_port", " %hu",
|
||||
print_hu(PRINT_ANY, "local_port", " %hu",
|
||||
p->local_udp_port);
|
||||
print_uint(PRINT_ANY, "peer_port", "/%hu",
|
||||
print_hu(PRINT_ANY, "peer_port", "/%hu",
|
||||
p->peer_udp_port);
|
||||
print_nl();
|
||||
|
||||
|
||||
@ -353,9 +353,9 @@ void bpf_print_ops(struct rtattr *bpf_ops, __u16 len)
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
open_json_object(NULL);
|
||||
print_uint(PRINT_ANY, "code", "%hu ", ops[i].code);
|
||||
print_uint(PRINT_ANY, "jt", "%hhu ", ops[i].jt);
|
||||
print_uint(PRINT_ANY, "jf", "%hhu ", ops[i].jf);
|
||||
print_hu(PRINT_ANY, "code", "%hu ", ops[i].code);
|
||||
print_hhu(PRINT_ANY, "jt", "%hhu ", ops[i].jt);
|
||||
print_hhu(PRINT_ANY, "jf", "%hhu ", ops[i].jf);
|
||||
if (i == len - 1)
|
||||
print_uint(PRINT_ANY, "k", "%u\'", ops[i].k);
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user