Re: [B.A.T.M.A.N.] [PATCH v2 6/7] batman-adv: ELP - use tp meter to estimate the throughput if otherwise not available

Sven Eckelmann
2018-05-21T17:51:49Z

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

On Montag, 21. Mai 2018 15:17:11 CEST Linus Lüssing wrote:
> What is the advantage of using the ilog2 and shift operator here
> compared to plain multiplications and divisions?

They most likely ran into the problem that they must do a 64 bit division
(which cannot be done on 32 bit machines in the kernel directly with C's
native "x / y" statement ). But in this case, it is most likely a lot better
to use do_div (or similar function) to avoid a lot of rounding problems which
this shift approach has.

Kind regards,
Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]