Skip to content

Commit

Permalink
[NET] netconsole: Use netif_running() in write_msg()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Satyam Sharma authored and David S. Miller committed Oct 10, 2007
1 parent d2b6088 commit 0cc120b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions drivers/net/netconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 0cc120b

Please sign in to comment.