aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/mconsole_kern.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-01-06 03:19:05 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:48 -0500
commit3a331a511a2fe522034f3958eecf58751be434ac (patch)
tree4e1a5e3f1c1b3d46a685c7993afe8065f84a0786 /arch/um/drivers/mconsole_kern.c
parent4111b025dc64f33803d2147565147428dc51d014 (diff)
[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>
Diffstat (limited to 'arch/um/drivers/mconsole_kern.c')
-rw-r--r--arch/um/drivers/mconsole_kern.c96
1 files changed, 42 insertions, 54 deletions
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 8b453a7e685c..be610125429f 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -422,7 +422,7 @@ void mconsole_remove(struct mc_request *req)
422{ 422{
423 struct mc_device *dev; 423 struct mc_device *dev;
424 char *ptr = req->request.data, *err_msg = ""; 424 char *ptr = req->request.data, *err_msg = "";
425 char error[256]; 425 char error[256];
426 int err, start, end, n; 426 int err, start, end, n;
427 427
428 ptr += strlen("remove"); 428 ptr += strlen("remove");
@@ -433,33 +433,33 @@ void mconsole_remove(struct mc_request *req)
433 return; 433 return;
434 } 434 }
435 435
436 ptr = &ptr[strlen(dev->name)]; 436 ptr = &ptr[strlen(dev->name)];
437 437
438 err = 1; 438 err = 1;
439 n = (*dev->id)(&ptr, &start, &end); 439 n = (*dev->id)(&ptr, &start, &end);
440 if(n < 0){ 440 if(n < 0){
441 err_msg = "Couldn't parse device number"; 441 err_msg = "Couldn't parse device number";
442 goto out; 442 goto out;
443 } 443 }
444 else if((n < start) || (n > end)){ 444 else if((n < start) || (n > end)){
445 sprintf(error, "Invalid device number - must be between " 445 sprintf(error, "Invalid device number - must be between "
446 "%d and %d", start, end); 446 "%d and %d", start, end);
447 err_msg = error; 447 err_msg = error;
448 goto out; 448 goto out;
449 } 449 }
450 450
451 err = (*dev->remove)(n); 451 err = (*dev->remove)(n);
452 switch(err){ 452 switch(err){
453 case -ENODEV: 453 case -ENODEV:
454 err_msg = "Device doesn't exist"; 454 err_msg = "Device doesn't exist";
455 break; 455 break;
456 case -EBUSY: 456 case -EBUSY:
457 err_msg = "Device is currently open"; 457 err_msg = "Device is currently open";
458 break; 458 break;
459 default: 459 default:
460 break; 460 break;
461 } 461 }
462 out: 462out:
463 mconsole_reply(req, err_msg, err, 0); 463 mconsole_reply(req, err_msg, err, 0);
464} 464}
465 465
@@ -576,34 +576,33 @@ static void stack_proc(void *arg)
576 */ 576 */
577void do_stack(struct mc_request *req) 577void do_stack(struct mc_request *req)
578{ 578{
579 char *ptr = req->request.data; 579 char *ptr = req->request.data;
580 int pid_requested= -1; 580 int pid_requested= -1;
581 struct task_struct *from = NULL; 581 struct task_struct *from = NULL;
582 struct task_struct *to = NULL; 582 struct task_struct *to = NULL;
583 583
584 /* Would be nice: 584 /* Would be nice:
585 * 1) Send showregs output to mconsole. 585 * 1) Send showregs output to mconsole.
586 * 2) Add a way to stack dump all pids. 586 * 2) Add a way to stack dump all pids.
587 */ 587 */
588 588
589 ptr += strlen("stack"); 589 ptr += strlen("stack");
590 while(isspace(*ptr)) ptr++; 590 while(isspace(*ptr)) ptr++;
591 591
592 /* Should really check for multiple pids or reject bad args here */ 592 /* Should really check for multiple pids or reject bad args here */
593 /* What do the arguments in mconsole_reply mean? */ 593 /* What do the arguments in mconsole_reply mean? */
594 if(sscanf(ptr, "%d", &pid_requested) == 0){ 594 if(sscanf(ptr, "%d", &pid_requested) == 0){
595 mconsole_reply(req, "Please specify a pid", 1, 0); 595 mconsole_reply(req, "Please specify a pid", 1, 0);
596 return; 596 return;
597 } 597 }
598 598
599 from = current; 599 from = current;
600 600
601 to = find_task_by_pid(pid_requested); 601 to = find_task_by_pid(pid_requested);
602 if((to == NULL) || (pid_requested == 0)) { 602 if((to == NULL) || (pid_requested == 0)) {
603 mconsole_reply(req, "Couldn't find that pid", 1, 0); 603 mconsole_reply(req, "Couldn't find that pid", 1, 0);
604 return; 604 return;
605 } 605 }
606
607 with_console(req, stack_proc, to); 606 with_console(req, stack_proc, to);
608} 607}
609 608
@@ -772,14 +771,3 @@ char *mconsole_notify_socket(void)
772} 771}
773 772
774EXPORT_SYMBOL(mconsole_notify_socket); 773EXPORT_SYMBOL(mconsole_notify_socket);
775
776/*
777 * Overrides for Emacs so that we follow Linus's tabbing style.
778 * Emacs will notice this stuff at the end of the file and automatically
779 * adjust the settings for this buffer only. This must remain at the end
780 * of the file.
781 * ---------------------------------------------------------------------------
782 * Local variables:
783 * c-file-style: "linux"
784 * End:
785 */