[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fa55aa0f-b40f-fec3-2626-4a23e73fd1aa@gmail.com>
Date: Tue, 5 Feb 2019 14:59:55 -0800
From: David Ahern <dsahern@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>,
Davide Caratti <dcaratti@...hat.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2-next] tc: full JSON support for 'bpf' actions
On 2/5/19 2:53 PM, Stephen Hemminger wrote:
> On Thu, 31 Jan 2019 18:58:09 +0100
> Davide Caratti <dcaratti@...hat.com> wrote:
>
>> + 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);
>
> Did you know that print_uint promotes the argument to unsigned int
> then you are printing it with %hhu which expects only a u8.
>
I did look at the print_hhu option and it seems really weird that you
use "print_hhu(..., "%hhu", ...)" which is why I took the patch as is.
There are existing examples of print_uint with '%hu' too.
The print_ functions really should be renamed (print_uchar,
print_ushort, etc).
Powered by blists - more mailing lists