Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[WATCHDOG] Coding style - Indentation - part 1

This brings the watchdog drivers into line with coding style.
This patch takes cares of the indentation as described in chapter 1:
The preferred way to ease multiple indentation levels in a switch
statement is to align the "switch" and its subordinate "case"
labels in the same column instead of "double-indenting" the "case"
labels.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

+127 -129
+1 -1
drivers/watchdog/acquirewdt.c
··· 169 169 return 0; 170 170 171 171 case WDIOC_GETTIMEOUT: 172 - return put_user(WATCHDOG_HEARTBEAT, p); 172 + return put_user(WATCHDOG_HEARTBEAT, p); 173 173 174 174 case WDIOC_SETOPTIONS: 175 175 {
+1 -1
drivers/watchdog/geodewdt.c
··· 149 149 .identity = WATCHDOG_NAME, 150 150 }; 151 151 152 - switch(cmd) { 152 + switch (cmd) { 153 153 case WDIOC_GETSUPPORT: 154 154 return copy_to_user(argp, &ident, 155 155 sizeof(ident)) ? -EFAULT : 0;
+69 -69
drivers/watchdog/pcwd_pci.c
··· 470 470 }; 471 471 472 472 switch (cmd) { 473 - case WDIOC_GETSUPPORT: 474 - return copy_to_user(argp, &ident, 475 - sizeof (ident)) ? -EFAULT : 0; 473 + case WDIOC_GETSUPPORT: 474 + return copy_to_user(argp, &ident, 475 + sizeof (ident)) ? -EFAULT : 0; 476 476 477 - case WDIOC_GETSTATUS: 478 - { 479 - int status; 480 - pcipcwd_get_status(&status); 481 - return put_user(status, p); 477 + case WDIOC_GETSTATUS: 478 + { 479 + int status; 480 + pcipcwd_get_status(&status); 481 + return put_user(status, p); 482 + } 483 + 484 + case WDIOC_GETBOOTSTATUS: 485 + return put_user(pcipcwd_private.boot_status, p); 486 + 487 + case WDIOC_GETTEMP: 488 + { 489 + int temperature; 490 + 491 + if (pcipcwd_get_temperature(&temperature)) 492 + return -EFAULT; 493 + 494 + return put_user(temperature, p); 495 + } 496 + 497 + case WDIOC_KEEPALIVE: 498 + pcipcwd_keepalive(); 499 + return 0; 500 + 501 + case WDIOC_SETOPTIONS: 502 + { 503 + int new_options, retval = -EINVAL; 504 + 505 + if (get_user (new_options, p)) 506 + return -EFAULT; 507 + 508 + if (new_options & WDIOS_DISABLECARD) { 509 + if (pcipcwd_stop()) 510 + return -EIO; 511 + retval = 0; 482 512 } 483 513 484 - case WDIOC_GETBOOTSTATUS: 485 - return put_user(pcipcwd_private.boot_status, p); 486 - 487 - case WDIOC_GETTEMP: 488 - { 489 - int temperature; 490 - 491 - if (pcipcwd_get_temperature(&temperature)) 492 - return -EFAULT; 493 - 494 - return put_user(temperature, p); 514 + if (new_options & WDIOS_ENABLECARD) { 515 + if (pcipcwd_start()) 516 + return -EIO; 517 + retval = 0; 495 518 } 496 519 497 - case WDIOC_KEEPALIVE: 498 - pcipcwd_keepalive(); 499 - return 0; 500 - 501 - case WDIOC_SETOPTIONS: 502 - { 503 - int new_options, retval = -EINVAL; 504 - 505 - if (get_user (new_options, p)) 506 - return -EFAULT; 507 - 508 - if (new_options & WDIOS_DISABLECARD) { 509 - if (pcipcwd_stop()) 510 - return -EIO; 511 - retval = 0; 512 - } 513 - 514 - if (new_options & WDIOS_ENABLECARD) { 515 - if (pcipcwd_start()) 516 - return -EIO; 517 - retval = 0; 518 - } 519 - 520 - if (new_options & WDIOS_TEMPPANIC) { 521 - temp_panic = 1; 522 - retval = 0; 523 - } 524 - 525 - return retval; 520 + if (new_options & WDIOS_TEMPPANIC) { 521 + temp_panic = 1; 522 + retval = 0; 526 523 } 527 524 528 - case WDIOC_SETTIMEOUT: 529 - { 530 - int new_heartbeat; 525 + return retval; 526 + } 531 527 532 - if (get_user(new_heartbeat, p)) 533 - return -EFAULT; 528 + case WDIOC_SETTIMEOUT: 529 + { 530 + int new_heartbeat; 534 531 535 - if (pcipcwd_set_heartbeat(new_heartbeat)) 536 - return -EINVAL; 532 + if (get_user(new_heartbeat, p)) 533 + return -EFAULT; 537 534 538 - pcipcwd_keepalive(); 539 - /* Fall */ 540 - } 535 + if (pcipcwd_set_heartbeat(new_heartbeat)) 536 + return -EINVAL; 541 537 542 - case WDIOC_GETTIMEOUT: 543 - return put_user(heartbeat, p); 538 + pcipcwd_keepalive(); 539 + /* Fall */ 540 + } 544 541 545 - case WDIOC_GETTIMELEFT: 546 - { 547 - int time_left; 542 + case WDIOC_GETTIMEOUT: 543 + return put_user(heartbeat, p); 548 544 549 - if (pcipcwd_get_timeleft(&time_left)) 550 - return -EFAULT; 545 + case WDIOC_GETTIMELEFT: 546 + { 547 + int time_left; 551 548 552 - return put_user(time_left, p); 553 - } 549 + if (pcipcwd_get_timeleft(&time_left)) 550 + return -EFAULT; 554 551 555 - default: 556 - return -ENOTTY; 552 + return put_user(time_left, p); 553 + } 554 + 555 + default: 556 + return -ENOTTY; 557 557 } 558 558 } 559 559
+55 -55
drivers/watchdog/pcwd_usb.c
··· 382 382 }; 383 383 384 384 switch (cmd) { 385 - case WDIOC_GETSUPPORT: 386 - return copy_to_user(argp, &ident, 387 - sizeof (ident)) ? -EFAULT : 0; 385 + case WDIOC_GETSUPPORT: 386 + return copy_to_user(argp, &ident, 387 + sizeof (ident)) ? -EFAULT : 0; 388 388 389 - case WDIOC_GETSTATUS: 390 - case WDIOC_GETBOOTSTATUS: 391 - return put_user(0, p); 389 + case WDIOC_GETSTATUS: 390 + case WDIOC_GETBOOTSTATUS: 391 + return put_user(0, p); 392 392 393 - case WDIOC_GETTEMP: 394 - { 395 - int temperature; 393 + case WDIOC_GETTEMP: 394 + { 395 + int temperature; 396 396 397 - if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature)) 398 - return -EFAULT; 397 + if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature)) 398 + return -EFAULT; 399 399 400 - return put_user(temperature, p); 400 + return put_user(temperature, p); 401 + } 402 + 403 + case WDIOC_KEEPALIVE: 404 + usb_pcwd_keepalive(usb_pcwd_device); 405 + return 0; 406 + 407 + case WDIOC_SETOPTIONS: 408 + { 409 + int new_options, retval = -EINVAL; 410 + 411 + if (get_user (new_options, p)) 412 + return -EFAULT; 413 + 414 + if (new_options & WDIOS_DISABLECARD) { 415 + usb_pcwd_stop(usb_pcwd_device); 416 + retval = 0; 401 417 } 402 418 403 - case WDIOC_KEEPALIVE: 404 - usb_pcwd_keepalive(usb_pcwd_device); 405 - return 0; 406 - 407 - case WDIOC_SETOPTIONS: 408 - { 409 - int new_options, retval = -EINVAL; 410 - 411 - if (get_user (new_options, p)) 412 - return -EFAULT; 413 - 414 - if (new_options & WDIOS_DISABLECARD) { 415 - usb_pcwd_stop(usb_pcwd_device); 416 - retval = 0; 417 - } 418 - 419 - if (new_options & WDIOS_ENABLECARD) { 420 - usb_pcwd_start(usb_pcwd_device); 421 - retval = 0; 422 - } 423 - 424 - return retval; 419 + if (new_options & WDIOS_ENABLECARD) { 420 + usb_pcwd_start(usb_pcwd_device); 421 + retval = 0; 425 422 } 426 423 427 - case WDIOC_SETTIMEOUT: 428 - { 429 - int new_heartbeat; 424 + return retval; 425 + } 430 426 431 - if (get_user(new_heartbeat, p)) 432 - return -EFAULT; 427 + case WDIOC_SETTIMEOUT: 428 + { 429 + int new_heartbeat; 433 430 434 - if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat)) 435 - return -EINVAL; 431 + if (get_user(new_heartbeat, p)) 432 + return -EFAULT; 436 433 437 - usb_pcwd_keepalive(usb_pcwd_device); 438 - /* Fall */ 439 - } 434 + if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat)) 435 + return -EINVAL; 440 436 441 - case WDIOC_GETTIMEOUT: 442 - return put_user(heartbeat, p); 437 + usb_pcwd_keepalive(usb_pcwd_device); 438 + /* Fall */ 439 + } 443 440 444 - case WDIOC_GETTIMELEFT: 445 - { 446 - int time_left; 441 + case WDIOC_GETTIMEOUT: 442 + return put_user(heartbeat, p); 447 443 448 - if (usb_pcwd_get_timeleft(usb_pcwd_device, &time_left)) 449 - return -EFAULT; 444 + case WDIOC_GETTIMELEFT: 445 + { 446 + int time_left; 450 447 451 - return put_user(time_left, p); 452 - } 448 + if (usb_pcwd_get_timeleft(usb_pcwd_device, &time_left)) 449 + return -EFAULT; 453 450 454 - default: 455 - return -ENOTTY; 451 + return put_user(time_left, p); 452 + } 453 + 454 + default: 455 + return -ENOTTY; 456 456 } 457 457 } 458 458
-1
drivers/watchdog/sc1200wdt.c
··· 196 196 }; 197 197 198 198 switch (cmd) { 199 - 200 199 case WDIOC_GETSUPPORT: 201 200 if (copy_to_user(argp, &ident, sizeof ident)) 202 201 return -EFAULT;
+1 -2
drivers/watchdog/sc520_wdt.c
··· 290 290 .identity = "SC520", 291 291 }; 292 292 293 - switch (cmd) 294 - { 293 + switch (cmd) { 295 294 default: 296 295 return -ENOTTY; 297 296 case WDIOC_GETSUPPORT: