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)
commit89e478a2aa58af2548b7f316e4d5b6bcc9eade5b
tree59ae3e07a4e444237effc1b00652d733ddb2760c
parent0bccece59212466703590b1eee6924ab878545ff
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: 095dc8e0c368 ("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