forked from luck/tmp_suning_uos_patched
[PATCH] uml: fix whitespace in mconsole driver
Fix up some bogus spacing in the mconsole driver. Also delete the emacs formatting comment at the end. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
4111b025dc
commit
3a331a511a
@ -422,7 +422,7 @@ void mconsole_remove(struct mc_request *req)
|
|||||||
{
|
{
|
||||||
struct mc_device *dev;
|
struct mc_device *dev;
|
||||||
char *ptr = req->request.data, *err_msg = "";
|
char *ptr = req->request.data, *err_msg = "";
|
||||||
char error[256];
|
char error[256];
|
||||||
int err, start, end, n;
|
int err, start, end, n;
|
||||||
|
|
||||||
ptr += strlen("remove");
|
ptr += strlen("remove");
|
||||||
@ -433,33 +433,33 @@ void mconsole_remove(struct mc_request *req)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = &ptr[strlen(dev->name)];
|
ptr = &ptr[strlen(dev->name)];
|
||||||
|
|
||||||
err = 1;
|
err = 1;
|
||||||
n = (*dev->id)(&ptr, &start, &end);
|
n = (*dev->id)(&ptr, &start, &end);
|
||||||
if(n < 0){
|
if(n < 0){
|
||||||
err_msg = "Couldn't parse device number";
|
err_msg = "Couldn't parse device number";
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else if((n < start) || (n > end)){
|
else if((n < start) || (n > end)){
|
||||||
sprintf(error, "Invalid device number - must be between "
|
sprintf(error, "Invalid device number - must be between "
|
||||||
"%d and %d", start, end);
|
"%d and %d", start, end);
|
||||||
err_msg = error;
|
err_msg = error;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = (*dev->remove)(n);
|
err = (*dev->remove)(n);
|
||||||
switch(err){
|
switch(err){
|
||||||
case -ENODEV:
|
case -ENODEV:
|
||||||
err_msg = "Device doesn't exist";
|
err_msg = "Device doesn't exist";
|
||||||
break;
|
break;
|
||||||
case -EBUSY:
|
case -EBUSY:
|
||||||
err_msg = "Device is currently open";
|
err_msg = "Device is currently open";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
mconsole_reply(req, err_msg, err, 0);
|
mconsole_reply(req, err_msg, err, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -576,34 +576,33 @@ static void stack_proc(void *arg)
|
|||||||
*/
|
*/
|
||||||
void do_stack(struct mc_request *req)
|
void do_stack(struct mc_request *req)
|
||||||
{
|
{
|
||||||
char *ptr = req->request.data;
|
char *ptr = req->request.data;
|
||||||
int pid_requested= -1;
|
int pid_requested= -1;
|
||||||
struct task_struct *from = NULL;
|
struct task_struct *from = NULL;
|
||||||
struct task_struct *to = NULL;
|
struct task_struct *to = NULL;
|
||||||
|
|
||||||
/* Would be nice:
|
/* Would be nice:
|
||||||
* 1) Send showregs output to mconsole.
|
* 1) Send showregs output to mconsole.
|
||||||
* 2) Add a way to stack dump all pids.
|
* 2) Add a way to stack dump all pids.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ptr += strlen("stack");
|
ptr += strlen("stack");
|
||||||
while(isspace(*ptr)) ptr++;
|
while(isspace(*ptr)) ptr++;
|
||||||
|
|
||||||
/* Should really check for multiple pids or reject bad args here */
|
/* Should really check for multiple pids or reject bad args here */
|
||||||
/* What do the arguments in mconsole_reply mean? */
|
/* What do the arguments in mconsole_reply mean? */
|
||||||
if(sscanf(ptr, "%d", &pid_requested) == 0){
|
if(sscanf(ptr, "%d", &pid_requested) == 0){
|
||||||
mconsole_reply(req, "Please specify a pid", 1, 0);
|
mconsole_reply(req, "Please specify a pid", 1, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
from = current;
|
from = current;
|
||||||
|
|
||||||
to = find_task_by_pid(pid_requested);
|
to = find_task_by_pid(pid_requested);
|
||||||
if((to == NULL) || (pid_requested == 0)) {
|
if((to == NULL) || (pid_requested == 0)) {
|
||||||
mconsole_reply(req, "Couldn't find that pid", 1, 0);
|
mconsole_reply(req, "Couldn't find that pid", 1, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
with_console(req, stack_proc, to);
|
with_console(req, stack_proc, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -772,14 +771,3 @@ char *mconsole_notify_socket(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(mconsole_notify_socket);
|
EXPORT_SYMBOL(mconsole_notify_socket);
|
||||||
|
|
||||||
/*
|
|
||||||
* Overrides for Emacs so that we follow Linus's tabbing style.
|
|
||||||
* Emacs will notice this stuff at the end of the file and automatically
|
|
||||||
* adjust the settings for this buffer only. This must remain at the end
|
|
||||||
* of the file.
|
|
||||||
* ---------------------------------------------------------------------------
|
|
||||||
* Local variables:
|
|
||||||
* c-file-style: "linux"
|
|
||||||
* End:
|
|
||||||
*/
|
|
||||||
|
Loading…
Reference in New Issue
Block a user