android_kernel_google_msm/net/batman-adv
Akinobu Mita 6eec2413cb batman-adv: fix random jitter calculation
[ Upstream commit 143cdd8f33 ]

batadv_iv_ogm_emit_send_time() attempts to calculates a random integer
in the range of 'orig_interval +- BATADV_JITTER' by the below lines.

        msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER;
        msecs += (random32() % 2 * BATADV_JITTER);

But it actually gets 'orig_interval' or 'orig_interval - BATADV_JITTER'
because '%' and '*' have same precedence and associativity is
left-to-right.

This adds the parentheses at the appropriate position so that it matches
original intension.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Antonio Quartulli <ordex@autistici.org>
Cc: Marek Lindner <lindner_marek@yahoo.de>
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Cc: Antonio Quartulli <ordex@autistici.org>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-11 09:07:03 -08:00
..
bat_algo.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
bat_debugfs.c batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
bat_debugfs.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
bat_iv_ogm.c batman-adv: fix random jitter calculation 2013-01-11 09:07:03 -08:00
bat_sysfs.c batman-adv: Ignore 80-chars per line limits for strings 2012-03-11 06:29:44 +08:00
bat_sysfs.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
bitarray.c batman-adv: Fix indentation of multiline statements 2012-02-28 19:14:31 +08:00
bitarray.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
gateway_client.c batman-adv: Ignore 80-chars per line limits for strings 2012-03-11 06:29:44 +08:00
gateway_client.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
gateway_common.c batman-adv: Ignore 80-chars per line limits for strings 2012-03-11 06:29:44 +08:00
gateway_common.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
hard-interface.c batman-adv: Ignore 80-chars per line limits for strings 2012-03-11 06:29:44 +08:00
hard-interface.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
hash.c batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
hash.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
icmp_socket.c batman-adv: Ignore 80-chars per line limits for strings 2012-03-11 06:29:44 +08:00
icmp_socket.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
Kconfig batman-adv: improved client announcement mechanism 2011-06-20 11:37:24 +02:00
main.c batman-adv: Ignore 80-chars per line limits for strings 2012-03-11 06:29:44 +08:00
main.h batman-adv: Don't begin block comments with only a /* line 2012-03-11 06:29:44 +08:00
Makefile batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
originator.c batman-adv: Ignore 80-chars per line limits for strings 2012-03-11 06:29:44 +08:00
originator.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
packet.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
ring_buffer.c batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
ring_buffer.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
routing.c batman-adv: fix skb->data assignment 2012-07-16 09:04:11 -07:00
routing.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
send.c batman-adv: Remove spaces after a cast 2012-03-11 06:29:44 +08:00
send.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
soft-interface.c Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge 2012-03-11 15:36:34 -07:00
soft-interface.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
translation-table.c batman-adv: only drop packets of known wifi clients 2012-07-16 09:04:11 -07:00
translation-table.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
types.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
unicast.c batman-adv: Remove spaces after a cast 2012-03-11 06:29:44 +08:00
unicast.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
vis.c batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00
vis.h batman-adv: Update copyright years 2012-02-17 02:50:21 +08:00