diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-01-04 05:40:01 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-29 00:00:35 +0100 |
commit | 789675e216617b1331875c42a81f58227a06df91 (patch) | |
tree | bec5c846982ef2ebe5e6970242be146531add9b1 /net | |
parent | [TCP]: Perform setting of common control fields in one place (diff) | |
download | linux-789675e216617b1331875c42a81f58227a06df91.tar.xz linux-789675e216617b1331875c42a81f58227a06df91.zip |
[NET]: Avoid divides in net/core/gen_estimator.c
We can void divides (as seen with CONFIG_CC_OPTIMIZE_FOR_SIZE=y on x86)
changing ((HZ<<idx)/4) to ((HZ/4) << idx)
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/gen_estimator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index daadbcc4e8dd..86037d16f199 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c @@ -135,7 +135,7 @@ skip: } if (!list_empty(&elist[idx].list)) - mod_timer(&elist[idx].timer, jiffies + ((HZ<<idx)/4)); + mod_timer(&elist[idx].timer, jiffies + ((HZ/4) << idx)); rcu_read_unlock(); } @@ -191,7 +191,7 @@ int gen_new_estimator(struct gnet_stats_basic *bstats, } if (list_empty(&elist[idx].list)) - mod_timer(&elist[idx].timer, jiffies + ((HZ<<idx)/4)); + mod_timer(&elist[idx].timer, jiffies + ((HZ/4) << idx)); list_add_rcu(&est->list, &elist[idx].list); return 0; |