Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

warn: Turn the netdev timeout WARN_ON() into a WARN()

this patch turns the netdev timeout WARN_ON_ONCE() into a WARN_ONCE(),
so that the device and driver names are inside the warning message.
This helps automated tools like kerneloops.org to collect the data
and do statistics, as well as making it more likely that humans
cut-n-paste the important message as part of a bugreport.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arjan van de Ven and committed by
Linus Torvalds
45e9c0de c8b0f438

+11 -2
+10
include/asm-generic/bug.h
··· 97 97 unlikely(__ret_warn_once); \ 98 98 }) 99 99 100 + #define WARN_ONCE(condition, format...) ({ \ 101 + static int __warned; \ 102 + int __ret_warn_once = !!(condition); \ 103 + \ 104 + if (unlikely(__ret_warn_once)) \ 105 + if (WARN(!__warned, format)) \ 106 + __warned = 1; \ 107 + unlikely(__ret_warn_once); \ 108 + }) 109 + 100 110 #define WARN_ON_RATELIMIT(condition, state) \ 101 111 WARN_ON((condition) && __ratelimit(state)) 102 112
+1 -2
net/sched/sch_generic.c
··· 215 215 time_after(jiffies, (dev->trans_start + 216 216 dev->watchdog_timeo))) { 217 217 char drivername[64]; 218 - printk(KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit timed out\n", 218 + WARN_ONCE(1, KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit timed out\n", 219 219 dev->name, netdev_drivername(dev, drivername, 64)); 220 220 dev->tx_timeout(dev); 221 - WARN_ON_ONCE(1); 222 221 } 223 222 if (!mod_timer(&dev->watchdog_timer, 224 223 round_jiffies(jiffies +