* [PATCH] genetlink: optimize ctrl_dumpfamily()
@ 2010-01-08 8:10 Samir Bellabes
2010-01-14 4:40 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Samir Bellabes @ 2010-01-08 8:10 UTC (permalink / raw)
To: David S. Miller; +Cc: Thomas Graf, Johannes Berg, jamal, netdev
commit f3257ff67aac80d423227eae89281e506fed8cd6
Author: Samir Bellabes <sam@synack.fr>
Date: Fri Jan 8 08:44:41 2010 +0100
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>
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index d07ecda..a4b6e14 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)
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))
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-14 4:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-08 8:10 [PATCH] genetlink: optimize ctrl_dumpfamily() Samir Bellabes
2010-01-14 4:40 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).