From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f65.google.com ([209.85.215.65]:35118 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbeBZQHj (ORCPT ); Mon, 26 Feb 2018 11:07:39 -0500 Received: by mail-lf0-f65.google.com with SMTP id 70so23015111lfw.2 for ; Mon, 26 Feb 2018 08:07:38 -0800 (PST) Subject: Re: [PATCH iproute2-next v3 8/8] iplink: Reduce number of arguments to iplink_parse() To: David Ahern , netdev@vger.kernel.org References: <1519304526-18848-1-git-send-email-serhe.popovych@gmail.com> <1519304526-18848-9-git-send-email-serhe.popovych@gmail.com> <8f84887e-e0a7-fe3a-d2a3-21ab7544133a@gmail.com> From: Serhey Popovych Message-ID: Date: Mon, 26 Feb 2018 18:07:24 +0200 MIME-Version: 1.0 In-Reply-To: <8f84887e-e0a7-fe3a-d2a3-21ab7544133a@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="saBJRurbKmWmFjggnPR0m3OnsHi0Ngc1b" Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --saBJRurbKmWmFjggnPR0m3OnsHi0Ngc1b Content-Type: multipart/mixed; boundary="uVxsvT1QG8YSF6BvAchimEecb2rbuYgwV"; protected-headers="v1" From: Serhey Popovych To: David Ahern , netdev@vger.kernel.org Message-ID: Subject: Re: [PATCH iproute2-next v3 8/8] iplink: Reduce number of arguments to iplink_parse() References: <1519304526-18848-1-git-send-email-serhe.popovych@gmail.com> <1519304526-18848-9-git-send-email-serhe.popovych@gmail.com> <8f84887e-e0a7-fe3a-d2a3-21ab7544133a@gmail.com> In-Reply-To: <8f84887e-e0a7-fe3a-d2a3-21ab7544133a@gmail.com> --uVxsvT1QG8YSF6BvAchimEecb2rbuYgwV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable David Ahern wrote: > On 2/22/18 6:02 AM, Serhey Popovych wrote: >> Introduce new @struct iplink_parse_args data structure to consolidate >> arguments to iplink_parse(). This will reduce number of arguments >> passed to it. >> >> Pass this data structure to ->parse_opt() in iplink specific modules: >> it may be used to get network device name and other information. >> >> Signed-off-by: Serhey Popovych >> --- >> ip/ip_common.h | 16 +++++++++++++--- >> ip/iplink.c | 34 ++++++++++++++++++++++------------ >> ip/iplink_bond.c | 4 +++- >> ip/iplink_bond_slave.c | 4 +++- >> ip/iplink_bridge.c | 4 +++- >> ip/iplink_bridge_slave.c | 4 +++- >> ip/iplink_can.c | 4 +++- >> ip/iplink_geneve.c | 4 +++- >> ip/iplink_hsr.c | 4 +++- >> ip/iplink_ipoib.c | 4 +++- >> ip/iplink_ipvlan.c | 4 +++- >> ip/iplink_macvlan.c | 4 +++- >> ip/iplink_vlan.c | 4 +++- >> ip/iplink_vrf.c | 5 ++++- >> ip/iplink_vxcan.c | 14 ++++++-------- >> ip/iplink_vxlan.c | 4 +++- >> ip/ipmacsec.c | 4 +++- >> ip/link_gre.c | 6 ++++-- >> ip/link_gre6.c | 6 ++++-- >> ip/link_ip6tnl.c | 6 ++++-- >> ip/link_iptnl.c | 6 ++++-- >> ip/link_veth.c | 14 ++++++-------- >> ip/link_vti.c | 6 ++++-- >> ip/link_vti6.c | 6 ++++-- >> 24 files changed, 114 insertions(+), 57 deletions(-) >> >=20 > Seems like a lot of churn for no benefit. Real benefit at the moment: reduce number of parameters in function iplink_parse() that has trend to grow. Someone needs something in ->parse_opt() that is in netlink buffer. How to provide this best? In my opinion is to add field to struct rather than argument to a functio= n. >=20 >=20 --uVxsvT1QG8YSF6BvAchimEecb2rbuYgwV-- --saBJRurbKmWmFjggnPR0m3OnsHi0Ngc1b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJalDDFAAoJEBTawMmQ61bBowEH/i247PLTdfxuHA/O6pxSFd9G m6mg2NSOz+RQ/IA1PuV3dZoybhswgpTNHN3q0fKGQ1C2GpynRZgYnjRo91dYy/xl Osq4csK4IpEhKFSoDinu8rdMvH0gp+nrL9+u5oCaXrDctJTwAEdEF9Ji6rqqdCpn 913Kdfb4FRSxtMk0WGaCYHb+CpbLV2kiF5gjM0eJVkPvOEXf4N/BoPElzI/d4P93 Ed2ezGMTod0o1vHoduAKZa0cvhIV0gudZmpn2wdVOKppk3REpasLAjhDh9czfx9Z wSG/LaKVxF9yGCLNYGS7HO67Pj+zuQlFsjsricchFUQ7xxP8ZpIV19kfyTpahzU= =wcfl -----END PGP SIGNATURE----- --saBJRurbKmWmFjggnPR0m3OnsHi0Ngc1b--