summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Ellero <luca.ellero@brickedbrain.com>2014-07-11 16:56:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-11 17:33:11 -0700
commit6cfa015217dbb4df7b38e58db509f2a151a6de47 (patch)
tree3aa929201725a3ffbb080a7e290a8640845c2740
parentc626bd5b7b2356f13e2a55396ebe3298a9451857 (diff)
downloadop-kernel-dev-6cfa015217dbb4df7b38e58db509f2a151a6de47.zip
op-kernel-dev-6cfa015217dbb4df7b38e58db509f2a151a6de47.tar.gz
staging: ced1401: ced_ioc.c: remove else branch in ced_wait_event
Fix checkpatch warning "else is not generally useful after a break or return" in file ced_ioc.c, function ced_wait_event() Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/ced1401/ced_ioc.c65
1 files changed, 33 insertions, 32 deletions
diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c
index cb075af..0a40246 100644
--- a/drivers/staging/ced1401/ced_ioc.c
+++ b/drivers/staging/ced1401/ced_ioc.c
@@ -887,48 +887,49 @@ int ced_set_event(struct ced_data *ced, struct transfer_event __user *ute)
int ced_wait_event(struct ced_data *ced, int area, int time_out)
{
int ret;
+ int wait;
+ struct transarea *ta;
if ((unsigned)area >= MAX_TRANSAREAS)
return U14ERR_BADAREA;
- else {
- int wait;
- struct transarea *ta = &ced->trans_def[area];
- /* convert timeout to jiffies */
- time_out = (time_out * HZ + 999) / 1000;
+ ta = &ced->trans_def[area];
- /* We cannot wait holding the mutex, but we check the flags */
- /* while holding it. This may well be pointless as another */
- /* thread could get in between releasing it and the wait */
- /* call. However, this would have to clear the wake_up flag. */
- /* However, the !ta->used may help us in this case. */
+ /* convert timeout to jiffies */
+ time_out = (time_out * HZ + 999) / 1000;
- /* make sure we have no competitor */
- mutex_lock(&ced->io_mutex);
- if (!ta->used || !ta->event_sz) /* check something to */
- /* wait for... */
- return U14ERR_NOTSET; /* ...else we do nothing */
- mutex_unlock(&ced->io_mutex);
+ /* We cannot wait holding the mutex, but we check the flags */
+ /* while holding it. This may well be pointless as another */
+ /* thread could get in between releasing it and the wait */
+ /* call. However, this would have to clear the wake_up flag. */
+ /* However, the !ta->used may help us in this case. */
- if (time_out)
- wait = wait_event_interruptible_timeout(ta->event,
- ta->wake_up ||
- !ta->used,
- time_out);
- else
- wait = wait_event_interruptible(ta->event,
+ /* make sure we have no competitor */
+ mutex_lock(&ced->io_mutex);
+ if (!ta->used || !ta->event_sz) /* check something to */
+ /* wait for... */
+ return U14ERR_NOTSET; /* ...else we do nothing */
+ mutex_unlock(&ced->io_mutex);
+
+ if (time_out)
+ wait = wait_event_interruptible_timeout(ta->event,
ta->wake_up ||
- !ta->used);
+ !ta->used,
+ time_out);
+ else
+ wait = wait_event_interruptible(ta->event,
+ ta->wake_up ||
+ !ta->used);
+
+ if (wait)
+ ret = -ERESTARTSYS; /* oops - we have had a SIGNAL */
+ else
+ ret = ta->wake_up; /* else the wakeup count */
- if (wait)
- ret = -ERESTARTSYS; /* oops - we have had a SIGNAL */
- else
- ret = ta->wake_up; /* else the wakeup count */
+ spin_lock_irq(&ced->staged_lock);
+ ta->wake_up = 0; /* clear the flag */
+ spin_unlock_irq(&ced->staged_lock);
- spin_lock_irq(&ced->staged_lock);
- ta->wake_up = 0; /* clear the flag */
- spin_unlock_irq(&ced->staged_lock);
- }
return ret;
}
OpenPOWER on IntegriCloud