Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1d5a010 authored by Samir Bellabes's avatar Samir Bellabes Committed by David S. Miller
Browse files

genetlink: optimize ctrl_dumpfamily()



there is a unnecessary test which can be replaced by a good initialization in
the 'for' statement

Noticed by Serge E. Hallyn <serue@us.ibm.com>

Signed-off-by: default avatarSamir Bellabes <sam@synack.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 37fce430
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -681,9 +681,7 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb)
	int chains_to_skip = cb->args[0];
	int fams_to_skip = cb->args[1];

	for (i = 0; i < GENL_FAM_TAB_SIZE; i++) {
		if (i < chains_to_skip)
			continue;
	for (i = chains_to_skip; i < GENL_FAM_TAB_SIZE; i++) {
		n = 0;
		list_for_each_entry(rt, genl_family_chain(i), family_list) {
			if (!rt->netnsok && !net_eq(net, &init_net))