Commit 7968ace9 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] uml: mconsole fixes and cleanups

This patch
	makes a couple of functions static
	tidies code a bit
	sends a response on shutdown before the shutdown happens
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 34f88c60
...@@ -51,27 +51,26 @@ static struct notifier_block reboot_notifier = { ...@@ -51,27 +51,26 @@ static struct notifier_block reboot_notifier = {
LIST_HEAD(mc_requests); LIST_HEAD(mc_requests);
void mc_work_proc(void *unused) static void mc_work_proc(void *unused)
{ {
struct mconsole_entry *req; struct mconsole_entry *req;
unsigned long flags; unsigned long flags;
int done;
do { while(!list_empty(&mc_requests)){
local_save_flags(flags); local_save_flags(flags);
req = list_entry(mc_requests.next, struct mconsole_entry, req = list_entry(mc_requests.next, struct mconsole_entry,
list); list);
list_del(&req->list); list_del(&req->list);
done = list_empty(&mc_requests);
local_irq_restore(flags); local_irq_restore(flags);
req->request.cmd->handler(&req->request); req->request.cmd->handler(&req->request);
kfree(req); kfree(req);
} while(!done); }
} }
DECLARE_WORK(mconsole_work, mc_work_proc, NULL); DECLARE_WORK(mconsole_work, mc_work_proc, NULL);
irqreturn_t mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t mconsole_interrupt(int irq, void *dev_id,
struct pt_regs *regs)
{ {
int fd; int fd;
struct mconsole_entry *new; struct mconsole_entry *new;
...@@ -91,7 +90,8 @@ irqreturn_t mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -91,7 +90,8 @@ irqreturn_t mconsole_interrupt(int irq, void *dev_id, struct pt_regs *regs)
} }
} }
} }
if(!list_empty(&mc_requests)) schedule_work(&mconsole_work); if(!list_empty(&mc_requests))
schedule_work(&mconsole_work);
reactivate_fd(fd, MCONSOLE_IRQ); reactivate_fd(fd, MCONSOLE_IRQ);
return(IRQ_HANDLED); return(IRQ_HANDLED);
} }
...@@ -374,8 +374,8 @@ void mconsole_sysrq(struct mc_request *req) ...@@ -374,8 +374,8 @@ void mconsole_sysrq(struct mc_request *req)
ptr += strlen("sysrq"); ptr += strlen("sysrq");
while(isspace(*ptr)) ptr++; while(isspace(*ptr)) ptr++;
handle_sysrq(*ptr, &current->thread.regs, NULL);
mconsole_reply(req, "", 0, 0); mconsole_reply(req, "", 0, 0);
handle_sysrq(*ptr, &current->thread.regs, NULL);
} }
#else #else
void mconsole_sysrq(struct mc_request *req) void mconsole_sysrq(struct mc_request *req)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment