On Tue, 30 Jan 2018 18:52:48 +0200
Serhey Popovych <serhe.popov...@gmail.com> wrote:

> +     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 == AF_PACKET) {
> +                     if (tb[IFLA_ADDRESS]) {
> +                             struct rtattr *rta = 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;
> +     }

To keep function shorter and therefore more readable, why not:

        if (brief)
                return print_linkinfo_brief(fp, ifi, tb);

And put this if branch in new version of print_linkinfo_brief.

Reply via email to