Skip to contentSkip to conversation

inet_hashtables.c: warning: division by zero

DISCUSSION Meelis Roos 2 participants 2 messages Aug 19, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Noticed this while compiling 4.2-rc7+git on i386 with gcc 4.9.2:

CC net/ipv4/inet_hashtables.o
In file included from include/linux/list.h:8:0,

                 from include/linux/module.h:9,
                 from net/ipv4/inet_hashtables.c:16:

net/ipv4/inet_hashtables.c: In function ‘inet_ehash_locks_alloc’:
net/ipv4/inet_hashtables.c:632:24: warning: division by zero [-Wdiv-by-zero]
2 * L1_CACHE_BYTES / sizeof(spinlock_t),
^
include/linux/kernel.h:769:17: note: in definition of macro ‘max_t’

  type __max1 = (x);   \
                 ^
Signature · 1 line
Meelis Roos ([email protected])
#1 lore raw
Quoted 6 lines · Meelis Roos

Noticed this while compiling 4.2-rc7+git on i386 with gcc 4.9.2:

CC net/ipv4/inet_hashtables.o
In file included from include/linux/list.h:8:0,

                 from include/linux/module.h:9,
                 from net/ipv4/inet_hashtables.c:16:
Quoted 8 lines

net/ipv4/inet_hashtables.c: In function ‘inet_ehash_locks_alloc’:
net/ipv4/inet_hashtables.c:632:24: warning: division by zero [-Wdiv-by-zero]
2 * L1_CACHE_BYTES / sizeof(spinlock_t),
^
include/linux/kernel.h:769:17: note: in definition of macro ‘max_t’

  type __max1 = (x);   \
                 ^

This warning was fixed :

http://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=89e478a2aa58af2548b7f316e4d5b6bcc9eade5b