2018-02-20, 00:19:25 +0200, Serhey Popovych wrote: > I get following checkpatch.pl warnings: > > WARNING: Missing a blank line after declarations > #73: FILE: ip/iptuntap.c:497: > + __u8 mq = rta_getattr_u8(tb[IFLA_TUN_MULTI_QUEUE]); > + if (!mq) > > WARNING: Missing a blank line after declarations > #80: FILE: ip/iptuntap.c:504: > + __u32 numq = rta_getattr_u32(tb[IFLA_TUN_NUM_QUEUES]); > + fprintf(f, "numqueues %u ", numq); > > WARNING: Missing a blank line after declarations > #85: FILE: ip/iptuntap.c:509: > + __u32 numq = > rta_getattr_u32(tb[IFLA_TUN_NUM_DISABLED_QUEUES]); > + fprintf(f, "numdisabled %u ", numq); > > maybe they should be fixed before accepting?
IMHO fixing those makes the code slightly uglier, but sure, I'll send a v2. > I wonder if we can use tun_print_opt() and it's infrastructure > in print_tuntap(). Now they use read_prop() to read same information > from sysfs while netlink provides it. I wouldn't, for 2 reasons: - these netlink attributes aren't exposed by older kernels, so if you run "ip tuntap" on an older kernel, you won't get any information about tun/tap devices anymore - the output format is not the same, I don't want to break existing users of ip tuntap that expect a specific format -- Sabrina