[WATCHDOG] Coding style - Indentation - part 1
authorWim Van Sebroeck <wim@iguana.be>
Thu, 17 Jul 2008 18:08:47 +0000 (18:08 +0000)
committerWim Van Sebroeck <wim@iguana.be>
Wed, 6 Aug 2008 13:21:05 +0000 (13:21 +0000)
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>
drivers/watchdog/acquirewdt.c
drivers/watchdog/geodewdt.c
drivers/watchdog/pcwd_pci.c
drivers/watchdog/pcwd_usb.c
drivers/watchdog/sc1200wdt.c
drivers/watchdog/sc520_wdt.c

index 28d9057c9be66f5c660b9efcda762689cbe18f76..340d1eeec16b408686fdf59d58ffb3fa3435972f 100644 (file)
@@ -169,7 +169,7 @@ static long acq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                return 0;
 
        case WDIOC_GETTIMEOUT:
-         return put_user(WATCHDOG_HEARTBEAT, p);
+               return put_user(WATCHDOG_HEARTBEAT, p);
 
        case WDIOC_SETOPTIONS:
        {
index a41f57ce581ae29e2b69f91fcd1ddd1cfa46a49a..74c00698801dde4d351334e54978604b9bcf7987 100644 (file)
@@ -149,7 +149,7 @@ geodewdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                .identity =             WATCHDOG_NAME,
         };
 
-       switch(cmd) {
+       switch (cmd) {
        case WDIOC_GETSUPPORT:
                return copy_to_user(argp, &ident,
                                    sizeof(ident)) ? -EFAULT : 0;
index 67d90810c6e95542c187089d92f584773b6179f1..7f500ee4ee8a1e607d7ffcf95664c01a10498c98 100644 (file)
@@ -470,90 +470,90 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd,
        };
 
        switch (cmd) {
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident,
-                               sizeof (ident)) ? -EFAULT : 0;
-
-               case WDIOC_GETSTATUS:
-               {
-                       int status;
-                       pcipcwd_get_status(&status);
-                       return put_user(status, p);
-               }
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &ident,
+                       sizeof (ident)) ? -EFAULT : 0;
+
+       case WDIOC_GETSTATUS:
+       {
+               int status;
+               pcipcwd_get_status(&status);
+               return put_user(status, p);
+       }
 
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(pcipcwd_private.boot_status, p);
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(pcipcwd_private.boot_status, p);
 
-               case WDIOC_GETTEMP:
-               {
-                       int temperature;
+       case WDIOC_GETTEMP:
+       {
+               int temperature;
 
-                       if (pcipcwd_get_temperature(&temperature))
-                               return -EFAULT;
+               if (pcipcwd_get_temperature(&temperature))
+                       return -EFAULT;
 
-                       return put_user(temperature, p);
-               }
-
-               case WDIOC_KEEPALIVE:
-                       pcipcwd_keepalive();
-                       return 0;
+               return put_user(temperature, p);
+       }
 
-               case WDIOC_SETOPTIONS:
-               {
-                       int new_options, retval = -EINVAL;
+       case WDIOC_KEEPALIVE:
+               pcipcwd_keepalive();
+               return 0;
 
-                       if (get_user (new_options, p))
-                               return -EFAULT;
+       case WDIOC_SETOPTIONS:
+       {
+               int new_options, retval = -EINVAL;
 
-                       if (new_options & WDIOS_DISABLECARD) {
-                               if (pcipcwd_stop())
-                                       return -EIO;
-                               retval = 0;
-                       }
+               if (get_user (new_options, p))
+                       return -EFAULT;
 
-                       if (new_options & WDIOS_ENABLECARD) {
-                               if (pcipcwd_start())
-                                       return -EIO;
-                               retval = 0;
-                       }
+               if (new_options & WDIOS_DISABLECARD) {
+                       if (pcipcwd_stop())
+                               return -EIO;
+                       retval = 0;
+               }
 
-                       if (new_options & WDIOS_TEMPPANIC) {
-                               temp_panic = 1;
-                               retval = 0;
-                       }
+               if (new_options & WDIOS_ENABLECARD) {
+                       if (pcipcwd_start())
+                               return -EIO;
+                       retval = 0;
+               }
 
-                       return retval;
+               if (new_options & WDIOS_TEMPPANIC) {
+                       temp_panic = 1;
+                       retval = 0;
                }
 
-               case WDIOC_SETTIMEOUT:
-               {
-                       int new_heartbeat;
+               return retval;
+       }
 
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
+       case WDIOC_SETTIMEOUT:
+       {
+               int new_heartbeat;
 
-                       if (pcipcwd_set_heartbeat(new_heartbeat))
-                           return -EINVAL;
+               if (get_user(new_heartbeat, p))
+                       return -EFAULT;
 
-                       pcipcwd_keepalive();
-                       /* Fall */
-               }
+               if (pcipcwd_set_heartbeat(new_heartbeat))
+                   return -EINVAL;
 
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
+               pcipcwd_keepalive();
+               /* Fall */
+       }
 
-               case WDIOC_GETTIMELEFT:
-               {
-                       int time_left;
+       case WDIOC_GETTIMEOUT:
+               return put_user(heartbeat, p);
 
-                       if (pcipcwd_get_timeleft(&time_left))
-                               return -EFAULT;
+       case WDIOC_GETTIMELEFT:
+       {
+               int time_left;
 
-                       return put_user(time_left, p);
-               }
+               if (pcipcwd_get_timeleft(&time_left))
+                       return -EFAULT;
+
+               return put_user(time_left, p);
+       }
 
-               default:
-                       return -ENOTTY;
+       default:
+               return -ENOTTY;
        }
 }
 
index bc399cf65cf71278e09047292d1d606ccf739dd8..8194435052c8c783b961fe54c90484d3d1e33aa8 100644 (file)
@@ -382,77 +382,77 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd,
        };
 
        switch (cmd) {
-               case WDIOC_GETSUPPORT:
-                       return copy_to_user(argp, &ident,
-                               sizeof (ident)) ? -EFAULT : 0;
+       case WDIOC_GETSUPPORT:
+               return copy_to_user(argp, &ident,
+                       sizeof (ident)) ? -EFAULT : 0;
 
-               case WDIOC_GETSTATUS:
-               case WDIOC_GETBOOTSTATUS:
-                       return put_user(0, p);
+       case WDIOC_GETSTATUS:
+       case WDIOC_GETBOOTSTATUS:
+               return put_user(0, p);
 
-               case WDIOC_GETTEMP:
-               {
-                       int temperature;
+       case WDIOC_GETTEMP:
+       {
+               int temperature;
 
-                       if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature))
-                               return -EFAULT;
+               if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature))
+                       return -EFAULT;
 
-                       return put_user(temperature, p);
-               }
+               return put_user(temperature, p);
+       }
 
-               case WDIOC_KEEPALIVE:
-                       usb_pcwd_keepalive(usb_pcwd_device);
-                       return 0;
+       case WDIOC_KEEPALIVE:
+               usb_pcwd_keepalive(usb_pcwd_device);
+               return 0;
 
-               case WDIOC_SETOPTIONS:
-               {
-                       int new_options, retval = -EINVAL;
+       case WDIOC_SETOPTIONS:
+       {
+               int new_options, retval = -EINVAL;
 
-                       if (get_user (new_options, p))
-                               return -EFAULT;
+               if (get_user (new_options, p))
+                       return -EFAULT;
 
-                       if (new_options & WDIOS_DISABLECARD) {
-                               usb_pcwd_stop(usb_pcwd_device);
-                               retval = 0;
-                       }
-
-                       if (new_options & WDIOS_ENABLECARD) {
-                               usb_pcwd_start(usb_pcwd_device);
-                               retval = 0;
-                       }
+               if (new_options & WDIOS_DISABLECARD) {
+                       usb_pcwd_stop(usb_pcwd_device);
+                       retval = 0;
+               }
 
-                       return retval;
+               if (new_options & WDIOS_ENABLECARD) {
+                       usb_pcwd_start(usb_pcwd_device);
+                       retval = 0;
                }
 
-               case WDIOC_SETTIMEOUT:
-               {
-                       int new_heartbeat;
+               return retval;
+       }
 
-                       if (get_user(new_heartbeat, p))
-                               return -EFAULT;
+       case WDIOC_SETTIMEOUT:
+       {
+               int new_heartbeat;
 
-                       if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat))
-                           return -EINVAL;
+               if (get_user(new_heartbeat, p))
+                       return -EFAULT;
 
-                       usb_pcwd_keepalive(usb_pcwd_device);
-                       /* Fall */
-               }
+               if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat))
+                   return -EINVAL;
 
-               case WDIOC_GETTIMEOUT:
-                       return put_user(heartbeat, p);
+               usb_pcwd_keepalive(usb_pcwd_device);
+               /* Fall */
+       }
 
-               case WDIOC_GETTIMELEFT:
-               {
-                       int time_left;
+       case WDIOC_GETTIMEOUT:
+               return put_user(heartbeat, p);
 
-                       if (usb_pcwd_get_timeleft(usb_pcwd_device, &time_left))
-                               return -EFAULT;
+       case WDIOC_GETTIMELEFT:
+       {
+               int time_left;
 
-                       return put_user(time_left, p);
-               }
+               if (usb_pcwd_get_timeleft(usb_pcwd_device, &time_left))
+                       return -EFAULT;
+
+               return put_user(time_left, p);
+       }
 
-               default:
-                       return -ENOTTY;
+       default:
+               return -ENOTTY;
        }
 }
 
index 621ebad56d86cdf798b22edf7a316c80eaa81e46..03e67fa4d68955907237c780f60be4cfe14eaa80 100644 (file)
@@ -196,7 +196,6 @@ static long sc1200wdt_ioctl(struct file *file, unsigned int cmd,
        };
 
        switch (cmd) {
-
        case WDIOC_GETSUPPORT:
                if (copy_to_user(argp, &ident, sizeof ident))
                        return -EFAULT;
index 01de239f49e88a7acfef11fb592fcb51c2d08d5d..1d5ba15dec63684bd3ca86a11aac3e5c24435dfc 100644 (file)
@@ -290,8 +290,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                .identity = "SC520",
        };
 
-       switch (cmd)
-       {
+       switch (cmd) {
        default:
                return -ENOTTY;
        case WDIOC_GETSUPPORT: