public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches•com>
To: Alexander Duyck <alexander.h.duyck@redhat•com>
Cc: netdev <netdev@vger•kernel.org>
Subject: fib_trie: commit 95f60ea3e99a missing else?
Date: Fri, 03 Apr 2015 13:53:02 -0700	[thread overview]
Message-ID: <1428094382.29510.8.camel@perches.com> (raw)

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

             reply	other threads:[~2015-04-03 20:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03 20:53 Joe Perches [this message]
2015-04-04  0:32 ` fib_trie: commit 95f60ea3e99a missing else? Alexander Duyck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428094382.29510.8.camel@perches.com \
    --to=joe@perches$(echo .)com \
    --cc=alexander.h.duyck@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox