On Thu, 2007-09-06 at 13:38 +0200, Sven-Ola Tuecke wrote:
[...]
> yep. Formula works only, if winsize can be divided by 4. Because the 
> expression already includes a "use old formula if winsize < 8", I would 
> simply extend with "also use old formula if 0 == winsize % 4. *And* change 
> the default winsize to 8 or 12. No further complaints.

Yup, that's pretty harmless.
Did I get all places?

BTW If I reformulate the subexpression in question
----  snip  ----
4 * ((entry->loss_window_size / 4 - 1) * entry->total_packets + entry->loss_window_size) / entry->loss_window_size
----  snip  ----
I come to 
----  snip  ----
(1 - 4 / entry->loss_window_size) * entry->total_packets + 4
----  snip  ----
which seems equivalent to the old one.

After looking more into it: Why do we have the "loss_window_size" in
"struct link_entry" in the first place? It is always initialized with
"olsr_cnf->lq_wsize" (which constant through run-time AFAIK) and
"loss_window_size" is never changed AFAICS?
Just killing like in the attached patch?

Since entry->loss_window_size is constant, we can precalculate it once
(floating point) and simply use it.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services

