From: David Ahern <dsahern@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>, netdev@vger.kernel.org
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [PATCH iproute2-next 05/11] flower: fix clang warnings
Date: Tue, 11 Jan 2022 09:00:29 -0700 [thread overview]
Message-ID: <a0f12df2-c914-0840-fd68-86c7de7a08b4@gmail.com> (raw)
In-Reply-To: <20220108204650.36185-6-sthemmin@microsoft.com>
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.
next prev parent reply other threads:[~2022-01-11 16:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-08 20:46 [PATCH iproute2-next 00/11] Clang warning fixes Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 01/11] tc: add format attribute to tc_print_rate Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 02/11] utils: add format attribute Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 03/11] netem: fix clang warnings Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 04/11] m_vlan: fix formatting of push ethernet src mac Stephen Hemminger
2022-01-08 21:29 ` Guillaume Nault
2022-01-08 20:46 ` [PATCH iproute2-next 05/11] flower: fix clang warnings Stephen Hemminger
2022-01-11 16:00 ` David Ahern [this message]
2022-01-08 20:46 ` [PATCH iproute2-next 06/11] nexthop: fix clang warning about timer check Stephen Hemminger
2022-01-11 13:31 ` Ido Schimmel
2022-01-11 16:01 ` David Ahern
2022-01-08 20:46 ` [PATCH iproute2-next 07/11] tc_util: fix clang warning in print_masked_type Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 08/11] ipl2tp: fix clang warning Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 09/11] can: " Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 10/11] tipc: fix clang warning about empty format string Stephen Hemminger
2022-01-08 20:46 ` [PATCH iproute2-next 11/11] tunnel: fix clang warning Stephen Hemminger
2022-01-10 17:20 ` [PATCH iproute2-next 00/11] Clang warning fixes Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a0f12df2-c914-0840-fd68-86c7de7a08b4@gmail.com \
--to=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=sthemmin@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).