]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: suppress a division by zero warning
authorEric Dumazet <edumazet@google.com>
Wed, 22 Jul 2015 05:02:00 +0000 (07:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Jul 2015 05:13:13 +0000 (22:13 -0700)
commit8a9609a163eae3d75771af400d2387437d652691
tree59ae3e07a4e444237effc1b00652d733ddb2760c
parentf9f635526bd413273096fbc80e9812e491b41813
tcp: suppress a division by zero warning

Andrew Morton reported following warning on one ARM build
with gcc-4.4 :

net/ipv4/inet_hashtables.c: In function 'inet_ehash_locks_alloc':
net/ipv4/inet_hashtables.c:617: warning: division by zero

Even guarded with a test on sizeof(spinlock_t), compiler does not
like current construct on a !CONFIG_SMP build.

Remove the warning by using a temporary variable.

Fixes: e9dbf706e839 ("tcp: fix/cleanup inet_ehash_locks_alloc()")
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inet_hashtables.c