netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fib_trie: commit 95f60ea3e99a missing else?
@ 2015-04-03 20:53 Joe Perches
  2015-04-04  0:32 ` Alexander Duyck
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2015-04-03 20:53 UTC (permalink / raw)
  To: Alexander Duyck; +Cc: netdev

Hello Alexander.

commit 95f60ea3e99a ("fib_trie: Add collapse() and should_collapse() to resize")
changed this block from:

	if (a && !b)
		...
	else if (!a && b)
		...

to:

	if (a && !b)
		...
	if (!a && b)
		... 

Was there a reason for the "else" removal?

I notice that object code size increases a bit (x86-64)
if the else is put back.

net/ipv4/fib_trie.c
[]
@@ -375,11 +388,11 @@ static void put_child(struct tnode *tn, unsigned long i, s
 
        BUG_ON(i >= tnode_child_length(tn));
 
-       /* update emptyChildren */
+       /* update emptyChildren, overflow into fullChildren */
        if (n == NULL && chi != NULL)
-               tn->empty_children++;
-       else if (n != NULL && chi == NULL)
-               tn->empty_children--;
+               empty_child_inc(tn);
+       if (n != NULL && chi == NULL)
+               empty_child_dec(tn);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-04  0:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-03 20:53 fib_trie: commit 95f60ea3e99a missing else? Joe Perches
2015-04-04  0:32 ` Alexander Duyck

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).