]> Git Repo - linux.git/commitdiff
[NET] netconsole: Use netif_running() in write_msg()
authorSatyam Sharma <[email protected]>
Fri, 10 Aug 2007 22:30:31 +0000 (15:30 -0700)
committerDavid S. Miller <[email protected]>
Wed, 10 Oct 2007 23:48:03 +0000 (16:48 -0700)
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]>
drivers/net/netconsole.c

index e56aa6c9743f6934d8eb4408aa4ba3c65c97efef..75cb76139ddc149bbfe56be3f9ec14e116b77dd3 100644 (file)
@@ -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 = {
This page took 0.053066 seconds and 4 git commands to generate.