From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serhey Popovych Subject: Re: [PATCH iproute2-next 6/6] ipaddress: Get rid of print_linkinfo_brief() Date: Tue, 30 Jan 2018 20:10:29 +0200 Message-ID: <7108fddb-b698-8d8f-9746-5540c6aca546@gmail.com> References: <1517331168-4132-1-git-send-email-serhe.popovych@gmail.com> <1517331168-4132-7-git-send-email-serhe.popovych@gmail.com> <20180130092412.42d9f6fc@xeon-e3> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qoryBzJc48jxLFENVi5FDR5mhnm0QKU1i" Cc: netdev@vger.kernel.org To: Stephen Hemminger Return-path: Received: from mail-wr0-f196.google.com ([209.85.128.196]:35639 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752411AbeA3SKi (ORCPT ); Tue, 30 Jan 2018 13:10:38 -0500 Received: by mail-wr0-f196.google.com with SMTP id w50so12201061wrc.2 for ; Tue, 30 Jan 2018 10:10:37 -0800 (PST) In-Reply-To: <20180130092412.42d9f6fc@xeon-e3> Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qoryBzJc48jxLFENVi5FDR5mhnm0QKU1i Content-Type: multipart/mixed; boundary="gFn5qaw2ckTwonY4t1THOziogaBOprw9H"; protected-headers="v1" From: Serhey Popovych To: Stephen Hemminger Cc: netdev@vger.kernel.org Message-ID: <7108fddb-b698-8d8f-9746-5540c6aca546@gmail.com> Subject: Re: [PATCH iproute2-next 6/6] ipaddress: Get rid of print_linkinfo_brief() References: <1517331168-4132-1-git-send-email-serhe.popovych@gmail.com> <1517331168-4132-7-git-send-email-serhe.popovych@gmail.com> <20180130092412.42d9f6fc@xeon-e3> In-Reply-To: <20180130092412.42d9f6fc@xeon-e3> --gFn5qaw2ckTwonY4t1THOziogaBOprw9H Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Stephen Hemminger wrote: > On Tue, 30 Jan 2018 18:52:48 +0200 > Serhey Popovych wrote: >=20 >> + if (brief) { >> + print_name_and_link("%-16s ", COLOR_NONE, name, tb); >> + >> + if (tb[IFLA_OPERSTATE]) >> + print_operstate(fp, rta_getattr_u8(tb[IFLA_OPERSTATE])); >> + >> + if (filter.family =3D=3D AF_PACKET) { >> + if (tb[IFLA_ADDRESS]) { >> + struct rtattr *rta =3D tb[IFLA_ADDRESS]; >> + >> + print_color_string(PRINT_ANY, >> + COLOR_MAC, >> + "address", >> + "%s ", >> + ll_addr_n2a(RTA_DATA(rta), >> + RTA_PAYLOAD(rta), >> + ifi->ifi_type, >> + b1, sizeof(b1))); >> + } >> + >> + print_link_flags(fp, ifi->ifi_flags, m_flag); >> + print_string(PRINT_FP, NULL, "%s", "\n"); >> + } >> + >> + fflush(fp); >> + return 0; >> + } >=20 > To keep function shorter and therefore more readable, why not: >=20 > if (brief) > return print_linkinfo_brief(fp, ifi, tb); >=20 > And put this if branch in new version of print_linkinfo_brief. >=20 Agree, will make it static and branch as suggested. Thanks. Addressed in v2. --gFn5qaw2ckTwonY4t1THOziogaBOprw9H-- --qoryBzJc48jxLFENVi5FDR5mhnm0QKU1i 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) iQEcBAEBAgAGBQJacLUaAAoJEBTawMmQ61bBuV4H/RFu3LFG/YYx4CuTxSgsCigf 9/e3oi9lctl6isJoK8U1mI1lJGsjUpnyfqQLy93r03YWpmbkcyF1/N3NSKjvXTbt vfV75SJaIIRJPRlIcQAQGYIVg6Tz7aeO9nXa2fRDot8/lB++zOxITip2X+N7GJs9 Q1KpSEyCmR7ij8DVFtzJDVW7u/fcNl/XX5g2xB9S5J3jCQZ0HirncXDJNKoSdz6Y 3L60wp7dXnfyngKlOzauVUJN0fmw+KGbMkNgXNhgAbsapfDJu45lfR0Qk/NA+RwO GW/rvfKLwJiw2o9sLazmEimpRRfnHFl5eZamS2m4R8Jbua/TSWwDi1/Ak6NceUQ= =KQ+l -----END PGP SIGNATURE----- --qoryBzJc48jxLFENVi5FDR5mhnm0QKU1i--