diff options
| author | Satyam Sharma <[email protected]> | 2007-08-10 22:30:31 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2007-10-10 23:48:03 +0000 |
| commit | 0cc120bea1d4ba3893a26c70d271e89f928b8a97 (patch) | |
| tree | 5ff99a2211acc2886889b994d1dd3b9e7b1ce892 /drivers/net/netconsole.c | |
| parent | [NET] netconsole: Simplify boot/module option setup logic (diff) | |
| download | kernel-0cc120bea1d4ba3893a26c70d271e89f928b8a97.tar.gz kernel-0cc120bea1d4ba3893a26c70d271e89f928b8a97.zip | |
[NET] netconsole: Use netif_running() in write_msg()
Based upon initial work by Keiichi Kii <[email protected]>.
Avoid unnecessarily disabling interrupts and calling netpoll_send_udp() if the
corresponding local interface is not up.
Signed-off-by: Satyam Sharma <[email protected]>
Acked-by: Keiichi Kii <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/netconsole.c')
| -rw-r--r-- | drivers/net/netconsole.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index e56aa6c9743f..75cb76139ddc 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -75,16 +75,16 @@ static void write_msg(struct console *con, const char *msg, unsigned int len) int frag, left; unsigned long flags; - local_irq_save(flags); - - for (left = len; left;) { - frag = min(left, MAX_PRINT_CHUNK); - netpoll_send_udp(&np, msg, frag); - msg += frag; - left -= frag; + if (netif_running(np.dev)) { + local_irq_save(flags); + for (left = len; left;) { + frag = min(left, MAX_PRINT_CHUNK); + netpoll_send_udp(&np, msg, frag); + msg += frag; + left -= frag; + } + local_irq_restore(flags); } - - local_irq_restore(flags); } static struct console netconsole = { |
