[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>
This commit is contained in:
Eric Dumazet 2008-01-03 20:40:01 -08:00 коммит произвёл David S. Miller
Родитель e870a8efcd
Коммит 789675e216
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -135,7 +135,7 @@ skip:
} }
if (!list_empty(&elist[idx].list)) 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(); rcu_read_unlock();
} }
@ -191,7 +191,7 @@ int gen_new_estimator(struct gnet_stats_basic *bstats,
} }
if (list_empty(&elist[idx].list)) 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); list_add_rcu(&est->list, &elist[idx].list);
return 0; return 0;