[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191113091825.5cfba26e@shemminger-XPS-13-9360>
Date: Wed, 13 Nov 2019 09:18:25 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Roi Dayan <roid@...lanox.com>
Cc: netdev@...r.kernel.org, David Ahern <dsahern@...il.com>,
Jiri Pirko <jiri@...lanox.com>,
Eli Britstein <elibr@...lanox.com>
Subject: Re: [PATCH iproute2 1/5] tc_util: introduce a function to print
JSON/non-JSON masked numbers
On Wed, 13 Nov 2019 12:12:41 +0200
Roi Dayan <roid@...lanox.com> wrote:
> +static void print_masked_type(__u32 type_max,
> + __u32 (*rta_getattr_type)(const struct rtattr *),
> + const char *name, struct rtattr *attr,
> + struct rtattr *mask_attr)
> +{
> + SPRINT_BUF(namefrm);
> + __u32 value, mask;
> + SPRINT_BUF(out);
> + size_t done;
> +
> + if (attr) {
code is cleaner if you use short circuit return here. i.e
if (!attr)
return;
...
Powered by blists - more mailing lists