Commit c626bd5b authored by Luca Ellero's avatar Luca Ellero Committed by Greg Kroah-Hartman

staging: ced1401: ced_ioc.c: remove else branch in ced_set_event

Fix checkpatch warning "else is not generally useful after a break or return" in
file ced_ioc.c, function ced_set_event()
Signed-off-by: default avatarLuca Ellero <luca.ellero@brickedbrain.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9609ce31
...@@ -844,6 +844,7 @@ int ced_set_event(struct ced_data *ced, struct transfer_event __user *ute) ...@@ -844,6 +844,7 @@ int ced_set_event(struct ced_data *ced, struct transfer_event __user *ute)
{ {
int ret = U14ERR_NOERROR; int ret = U14ERR_NOERROR;
struct transfer_event te; struct transfer_event te;
struct transarea *ta;
/* get a local copy of the data */ /* get a local copy of the data */
if (copy_from_user(&te, ute, sizeof(te))) if (copy_from_user(&te, ute, sizeof(te)))
...@@ -851,27 +852,28 @@ int ced_set_event(struct ced_data *ced, struct transfer_event __user *ute) ...@@ -851,27 +852,28 @@ int ced_set_event(struct ced_data *ced, struct transfer_event __user *ute)
if (te.wAreaNum >= MAX_TRANSAREAS) /* the area must exist */ if (te.wAreaNum >= MAX_TRANSAREAS) /* the area must exist */
return U14ERR_BADAREA; return U14ERR_BADAREA;
else {
struct transarea *ta = &ced->trans_def[te.wAreaNum];
/* make sure we have no competitor */ ta = &ced->trans_def[te.wAreaNum];
mutex_lock(&ced->io_mutex);
spin_lock_irq(&ced->staged_lock);
if (ta->used) { /* area must be in use */ /* make sure we have no competitor */
ta->event_st = te.dwStart; /* set area regions */ mutex_lock(&ced->io_mutex);
spin_lock_irq(&ced->staged_lock);
/* set size (0 cancels it) */ if (ta->used) { /* area must be in use */
ta->event_sz = te.dwLength; ta->event_st = te.dwStart; /* set area regions */
/* set size (0 cancels it) */
ta->event_sz = te.dwLength;
/* set the direction */
ta->event_to_host = te.wFlags & 1;
ta->wake_up = 0; /* zero the wake up count */
} else
ret = U14ERR_NOTSET;
spin_unlock_irq(&ced->staged_lock);
mutex_unlock(&ced->io_mutex);
/* set the direction */
ta->event_to_host = te.wFlags & 1;
ta->wake_up = 0; /* zero the wake up count */
} else
ret = U14ERR_NOTSET;
spin_unlock_irq(&ced->staged_lock);
mutex_unlock(&ced->io_mutex);
}
return ret == return ret ==
U14ERR_NOERROR ? (te.iSetEvent ? 1 : U14ERR_NOERROR) : ret; U14ERR_NOERROR ? (te.iSetEvent ? 1 : U14ERR_NOERROR) : ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment