]> git.baikalelectronics.ru Git - kernel.git/commit
e1000e: Fix incorrect debug warning
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Oct 2008 16:18:17 +0000 (09:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Oct 2008 16:18:17 +0000 (09:18 -0700)
commit51c23f70328641ba7f505433f09ce9bf579e68f5
tree2e6521929f791b047e3ab8ab259d9247f1488f86
parent7a0be714e443abcc5afaad0c52eabf1a8e92a0fc
e1000e: Fix incorrect debug warning

Doing 'WARN_ON(preempt_count())' was horribly horribly wrong, and would
cause tons of warnings at bootup if PREEMPT was enabled because the
initcalls currently run with the kernel lock, which increments the
preempt count.

At the same time, the warning was also insufficient, since it didn't
check that interrupts were enabled.

The proper debug function to use for something that can sleep and wants
a warning if it's called in the wrong context is 'might_sleep()'.

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/net/e1000e/ich8lan.c