aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netconsole.c
diff options
context:
space:
mode:
authorSatyam Sharma <satyam@infradead.org>2007-08-10 18:30:31 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:48:03 -0400
commit0cc120bea1d4ba3893a26c70d271e89f928b8a97 (patch)
tree5ff99a2211acc2886889b994d1dd3b9e7b1ce892 /drivers/net/netconsole.c
parentd2b60881e28072109601c373abd1085499ccfef0 (diff)
[NET] netconsole: Use netif_running() in write_msg()
Based upon initial work by Keiichi Kii <k-keiichi@bx.jp.nec.com>. Avoid unnecessarily disabling interrupts and calling netpoll_send_udp() if the corresponding local interface is not up. Signed-off-by: Satyam Sharma <satyam@infradead.org> Acked-by: Keiichi Kii <k-keiichi@bx.jp.nec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netconsole.c')
-rw-r--r--drivers/net/netconsole.c18
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)
75 int frag, left; 75 int frag, left;
76 unsigned long flags; 76 unsigned long flags;
77 77
78 local_irq_save(flags); 78 if (netif_running(np.dev)) {
79 79 local_irq_save(flags);
80 for (left = len; left;) { 80 for (left = len; left;) {
81 frag = min(left, MAX_PRINT_CHUNK); 81 frag = min(left, MAX_PRINT_CHUNK);
82 netpoll_send_udp(&np, msg, frag); 82 netpoll_send_udp(&np, msg, frag);
83 msg += frag; 83 msg += frag;
84 left -= frag; 84 left -= frag;
85 }
86 local_irq_restore(flags);
85 } 87 }
86
87 local_irq_restore(flags);
88} 88}
89 89
90static struct console netconsole = { 90static struct console netconsole = {