diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2008-07-18 07:41:17 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2008-08-06 09:21:09 -0400 |
commit | 0c06090c9472db0525cb6fe229c3bea33bbbbb3c (patch) | |
tree | b01c21f6ef5649b6f0071dee4a55cb3ba236a7b8 /drivers/watchdog/sbc7240_wdt.c | |
parent | 5eb82498e3a6da8a979c48945e3c1a85c10ccc25 (diff) |
[WATCHDOG] Coding style - Indentation - part 2
This brings the watchdog drivers into line with coding style.
This patch takes cares of the indentation as described in chapter 1.
Main changes:
* Re-structure the ioctl switch call for all drivers as follows:
switch (cmd) {
case WDIOC_GETSUPPORT:
case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
case WDIOC_GETTEMP:
case WDIOC_SETOPTIONS:
case WDIOC_KEEPALIVE:
case WDIOC_SETTIMEOUT:
case WDIOC_GETTIMEOUT:
case WDIOC_GETTIMELEFT:
default:
}
This to make the migration from the drivers to the uniform watchdog
device driver easier in the future.
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/sbc7240_wdt.c')
-rw-r--r-- | drivers/watchdog/sbc7240_wdt.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/drivers/watchdog/sbc7240_wdt.c b/drivers/watchdog/sbc7240_wdt.c index abccbe265249..67ddeb1c830a 100644 --- a/drivers/watchdog/sbc7240_wdt.c +++ b/drivers/watchdog/sbc7240_wdt.c | |||
@@ -177,39 +177,41 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
177 | case WDIOC_GETSTATUS: | 177 | case WDIOC_GETSTATUS: |
178 | case WDIOC_GETBOOTSTATUS: | 178 | case WDIOC_GETBOOTSTATUS: |
179 | return put_user(0, (int __user *)arg); | 179 | return put_user(0, (int __user *)arg); |
180 | case WDIOC_KEEPALIVE: | 180 | case WDIOC_SETOPTIONS: |
181 | wdt_keepalive(); | 181 | { |
182 | return 0; | 182 | int options; |
183 | case WDIOC_SETOPTIONS:{ | 183 | int retval = -EINVAL; |
184 | int options; | ||
185 | int retval = -EINVAL; | ||
186 | 184 | ||
187 | if (get_user(options, (int __user *)arg)) | 185 | if (get_user(options, (int __user *)arg)) |
188 | return -EFAULT; | 186 | return -EFAULT; |
189 | 187 | ||
190 | if (options & WDIOS_DISABLECARD) { | 188 | if (options & WDIOS_DISABLECARD) { |
191 | wdt_disable(); | 189 | wdt_disable(); |
192 | retval = 0; | 190 | retval = 0; |
193 | } | 191 | } |
194 | |||
195 | if (options & WDIOS_ENABLECARD) { | ||
196 | wdt_enable(); | ||
197 | retval = 0; | ||
198 | } | ||
199 | 192 | ||
200 | return retval; | 193 | if (options & WDIOS_ENABLECARD) { |
194 | wdt_enable(); | ||
195 | retval = 0; | ||
201 | } | 196 | } |
202 | case WDIOC_SETTIMEOUT:{ | ||
203 | int new_timeout; | ||
204 | 197 | ||
205 | if (get_user(new_timeout, (int __user *)arg)) | 198 | return retval; |
206 | return -EFAULT; | 199 | } |
200 | case WDIOC_KEEPALIVE: | ||
201 | wdt_keepalive(); | ||
202 | return 0; | ||
203 | case WDIOC_SETTIMEOUT: | ||
204 | { | ||
205 | int new_timeout; | ||
207 | 206 | ||
208 | if (wdt_set_timeout(new_timeout)) | 207 | if (get_user(new_timeout, (int __user *)arg)) |
209 | return -EINVAL; | 208 | return -EFAULT; |
210 | 209 | ||
211 | /* Fall through */ | 210 | if (wdt_set_timeout(new_timeout)) |
212 | } | 211 | return -EINVAL; |
212 | |||
213 | /* Fall through */ | ||
214 | } | ||
213 | case WDIOC_GETTIMEOUT: | 215 | case WDIOC_GETTIMEOUT: |
214 | return put_user(timeout, (int __user *)arg); | 216 | return put_user(timeout, (int __user *)arg); |
215 | default: | 217 | default: |