]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: ced1401: fix ced_wait_event()
authorLuca Ellero <luca.ellero@brickedbrain.com>
Thu, 10 Jul 2014 09:03:57 +0000 (11:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2014 22:10:05 +0000 (15:10 -0700)
Rename camel case arguments and locals in function ced_wait_event()

Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ced1401/ced_ioc.c
drivers/staging/ced1401/usb1401.h

index f00aff6d38184cb8d61a5aa5778920e8fb66df9a..707f8fa68ce15100bad6af658d3c76686e5c6073 100644 (file)
@@ -863,45 +863,51 @@ int ced_set_event(struct ced_data *ced, struct transfer_event __user *ute)
 ** of times that a block met the event condition since we last cleared it or
 ** 0 if timed out, or -ve error (bad area or not set, or signal).
 ****************************************************************************/
-int ced_wait_event(struct ced_data *ced, int nArea, int msTimeOut)
+int ced_wait_event(struct ced_data *ced, int area, int time_out)
 {
-       int iReturn;
-       if ((unsigned)nArea >= MAX_TRANSAREAS)
+       int ret;
+       if ((unsigned)area >= MAX_TRANSAREAS)
                return U14ERR_BADAREA;
        else {
-               int iWait;
-               struct transarea *pTA = &ced->trans_def[nArea];
-               msTimeOut = (msTimeOut * HZ + 999) / 1000;      /*  convert timeout to jiffies */
+               int wait;
+               struct transarea *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 */
-               /*  iWakeUp flag. However, the !pTA-bUsed may help us in this case. */
-               mutex_lock(&ced->io_mutex);     /*  make sure we have no competitor */
-               if (!pTA->used || !pTA->event_sz)       /*  check something to wait for... */
+                /* convert timeout to jiffies */
+               time_out = (time_out * HZ + 999) / 1000;
+
+               /* 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.          */
+
+               /* 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 (msTimeOut)
-                       iWait =
-                           wait_event_interruptible_timeout(pTA->event,
-                                                            pTA->wake_up
-                                                            || !pTA->used,
-                                                            msTimeOut);
+               if (time_out)
+                       wait = wait_event_interruptible_timeout(ta->event,
+                                                               ta->wake_up ||
+                                                               !ta->used,
+                                                               time_out);
                else
-                       iWait =
-                           wait_event_interruptible(pTA->event, pTA->wake_up
-                                                    || !pTA->used);
-               if (iWait)
-                       iReturn = -ERESTARTSYS; /*  oops - we have had a SIGNAL */
+                       wait = wait_event_interruptible(ta->event,
+                                                       ta->wake_up ||
+                                                       !ta->used);
+
+               if (wait)
+                       ret = -ERESTARTSYS; /* oops - we have had a SIGNAL */
                else
-                       iReturn = pTA->wake_up; /*  else the wakeup count */
+                       ret = ta->wake_up; /* else the wakeup count */
 
                spin_lock_irq(&ced->staged_lock);
-               pTA->wake_up = 0;       /*  clear the flag */
+               ta->wake_up = 0;        /*  clear the flag */
                spin_unlock_irq(&ced->staged_lock);
        }
-       return iReturn;
+       return ret;
 }
 
 /****************************************************************************
index d18755b2390d989b8679e66018723d6306f80f13..ac4062bde410cca4f820a3bcafa407749895aded 100644 (file)
@@ -253,6 +253,6 @@ extern int ced_dbg_stop_loop(struct ced_data *ced);
 extern int ced_set_circular(struct ced_data *ced, struct transfer_area_desc __user *pTD);
 extern int ced_get_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB);
 extern int ced_free_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB);
-extern int ced_wait_event(struct ced_data *ced, int nArea, int msTimeOut);
 extern int ced_test_event(struct ced_data *ced, int nArea);
+extern int ced_wait_event(struct ced_data *ced, int area, int time_out);
 #endif