All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Lindner <mareklindner@neomailbox.ch>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH-maint] batman-adv: Replace gw_reselect 64 bit div with shift
Date: Fri, 10 Jul 2015 16:12:29 +0800	[thread overview]
Message-ID: <8603159.s559zyjR10@voltaire> (raw)
In-Reply-To: <1434957203-6939-1-git-send-email-sven@narfation.org>

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

On Monday, June 22, 2015 09:13:23 Sven Eckelmann wrote:
> The 64-bit gw_factor is divided by BATADV_TQ_LOCAL_WINDOW_SIZE ** 2 * 64.
> But the rest of the calculation has nothing to do with the tq window size
> end therefore the calculation is just (tmp_gw_factor / (64 ** 3)).
> 
> The problem with 64 bit div is that it doesn't work on systems without
> native 64 bit div support. It has to be emulated using do_div or div_u64.
> The change in f63c54bba31d ("batman-adv: Avoid u32 overflow during gateway
> select") only compiled on such systems because the compiler converted the
> div to a (tmp_gw_factor >> 18). Making this explicit avoids having build
> problems in the future when BATADV_TQ_LOCAL_WINDOW_SIZE is changed in such
> a way that (BATADV_TQ_LOCAL_WINDOW_SIZE ** 2 * 64) is not a power of two.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  gateway_client.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)

Applied in revision 013aab3.

Thanks,
Marek

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

      parent reply	other threads:[~2015-07-10  8:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22  7:13 [B.A.T.M.A.N.] [PATCH-maint] batman-adv: Replace gw_reselect 64 bit div with shift Sven Eckelmann
2015-06-22 15:46 ` Antonio Quartulli
2015-07-10  8:12 ` Marek Lindner [this message]

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=8603159.s559zyjR10@voltaire \
    --to=mareklindner@neomailbox.ch \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.