aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink
diff options
context:
space:
mode:
authorSamir Bellabes <sam@synack.fr>2010-01-07 17:10:56 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-13 23:37:45 -0500
commite1d5a010729a7a495a8a8de85727f3f0d62f06a0 (patch)
treef1f5b01429ddf5ce7e023088f7ac705bed639db0 /net/netlink
parent37fce430dd66a6251bde6ef0004a1da69b26c028 (diff)
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: Samir Bellabes <sam@synack.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink')
-rw-r--r--net/netlink/genetlink.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index d07ecda0a92d..a4b6e148c5de 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -681,9 +681,7 @@ static int ctrl_dumpfamily(struct sk_buff *skb, struct netlink_callback *cb)
681 int chains_to_skip = cb->args[0]; 681 int chains_to_skip = cb->args[0];
682 int fams_to_skip = cb->args[1]; 682 int fams_to_skip = cb->args[1];
683 683
684 for (i = 0; i < GENL_FAM_TAB_SIZE; i++) { 684 for (i = chains_to_skip; i < GENL_FAM_TAB_SIZE; i++) {
685 if (i < chains_to_skip)
686 continue;
687 n = 0; 685 n = 0;
688 list_for_each_entry(rt, genl_family_chain(i), family_list) { 686 list_for_each_entry(rt, genl_family_chain(i), family_list) {
689 if (!rt->netnsok && !net_eq(net, &init_net)) 687 if (!rt->netnsok && !net_eq(net, &init_net))