[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a0f12df2-c914-0840-fd68-86c7de7a08b4@gmail.com>
Date: Tue, 11 Jan 2022 09:00:29 -0700
From: David Ahern <dsahern@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>,
netdev@...r.kernel.org
Cc: Stephen Hemminger <sthemmin@...rosoft.com>
Subject: Re: [PATCH iproute2-next 05/11] flower: fix clang warnings
On 1/8/22 1:46 PM, Stephen Hemminger wrote:
> @@ -1925,10 +1925,17 @@ static int __mask_bits(char *addr, size_t len)
> return bits;
> }
>
> -static void flower_print_eth_addr(char *name, struct rtattr *addr_attr,
> +static void flower_print_string(const char *name, const char *value)
> +{
> + print_nl();
> + print_string(PRINT_JSON, name, NULL, value);
> + print_string(PRINT_FP, NULL, " %s", name);
> + print_string(PRINT_FP, NULL, " %s", value);
> +}
> +
The last 3 lines could be a generic print_string_name_value function
under lib.
> @@ -2237,16 +2235,20 @@ static void flower_print_ct_mark(struct rtattr *attr,
> print_masked_u32("ct_mark", attr, mask_attr, true);
> }
>
> -static void flower_print_key_id(const char *name, struct rtattr *attr)
> +static void flower_print_uint(const char *name, unsigned int val)
> {
> - SPRINT_BUF(namefrm);
> + print_nl();
> + print_uint(PRINT_JSON, name, NULL, val);
> + print_string(PRINT_FP, NULL, " %s", name);
> + print_uint(PRINT_FP, NULL, " %%u", val);
s/%%u/%u/ ?
Same here the last 3 lines could be a lib function.
Powered by blists - more mailing lists