[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5daece37-2c57-d2ea-be23-23825b022742@kernel.org>
Date: Wed, 28 Sep 2022 22:09:52 -0600
From: David Ahern <dsahern@...nel.org>
To: Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc: Guillaume Nault <gnault@...hat.com>,
Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCHv2 iproute2-next] rtnetlink: add new function
rtnl_echo_talk()
On 9/28/22 8:23 PM, Hangbin Liu wrote:
> @@ -2609,23 +2604,9 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
> }
>
> if (echo_request)
> - ret = rtnl_talk(&rth, &req.n, &answer);
> + return rtnl_echo_talk(&rth, &req.n, json, print_addrinfo);
> else
> - ret = rtnl_talk(&rth, &req.n, NULL);
> -
> - if (ret < 0)
> - return -2;
> -
> - if (echo_request) {
> - new_json_obj(json);
> - open_json_object(NULL);
> - print_addrinfo(answer, stdout);
> - close_json_object();
> - delete_json_obj();
> - free(answer);
> - }
> -
> - return 0;
> + return rtnl_talk(&rth, &req.n, NULL);
you have a few occurrences of this and I can't fix it by editing the
patch. It should be this:
if (echo_request)
return rtnl_echo_talk(...)
return rtnl_talk(...)
i.e, no 'else' and the second return is only indented once.
Powered by blists - more mailing lists