]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
staging: ced1401: fix ced_clear_area()
authorLuca Ellero <luca.ellero@brickedbrain.com>
Thu, 10 Jul 2014 09:02:20 +0000 (11:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2014 22:09:26 +0000 (15:09 -0700)
Rename camel case arguments and locals in function ced_clear_area()

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 3f8bf6dd7070700e0a8a2053c1ce8983c518b4a7..9c629e242be91f574dca387b30f6357d07810a55 100644 (file)
@@ -607,75 +607,85 @@ int ced_get_out_buf_space(struct ced_data *ced)
 ** Clears up a transfer area. This is always called in the context of a user
 ** request, never from a call-back.
 ****************************************************************************/
-int ced_clear_area(struct ced_data *ced, int nArea)
+int ced_clear_area(struct ced_data *ced, int area)
 {
-       int iReturn = U14ERR_NOERROR;
+       int ret = U14ERR_NOERROR;
 
-       if ((nArea < 0) || (nArea >= MAX_TRANSAREAS)) {
-               iReturn = U14ERR_BADAREA;
+       if ((area < 0) || (area >= MAX_TRANSAREAS)) {
+               ret = U14ERR_BADAREA;
                dev_err(&ced->interface->dev, "%s: Attempt to clear area %d\n",
-                       __func__, nArea);
+                       __func__, area);
        } else {
                /* to save typing */
-               struct transarea *pTA = &ced->trans_def[nArea];
-               if (!pTA->used) /*  if not used... */
-                       iReturn = U14ERR_NOTSET;        /*  ...nothing to be done */
+               struct transarea *ta = &ced->trans_def[area];
+               if (!ta->used)  /*  if not used... */
+                       ret = U14ERR_NOTSET;    /*  ...nothing to be done */
                else {
-                       /*  We must save the memory we return as we shouldn't mess with memory while */
-                       /*  holding a spin lock. */
-                       struct page **pPages = NULL; /*save page address list*/
-                       int nPages = 0; /*  and number of pages */
+                       /*  We must save the memory we return as we shouldn't */
+                       /* mess with memory while holding a spin lock. */
+                       struct page **pages = NULL; /*save page address list*/
+                       int n_pages = 0;        /*  and number of pages */
                        int np;
 
                        dev_dbg(&ced->interface->dev, "%s: area %d\n",
-                               __func__, nArea);
+                               __func__, area);
                        spin_lock_irq(&ced->staged_lock);
-                       if ((ced->staged_id == nArea)
+                       if ((ced->staged_id == area)
                            && (ced->dma_flag > MODE_CHAR)) {
-                               iReturn = U14ERR_UNLOCKFAIL;    /*  cannot delete as in use */
+                               /* cannot delete as in use */
+                               ret = U14ERR_UNLOCKFAIL;
                                dev_err(&ced->interface->dev,
                                        "%s: call on area %d while active\n",
-                                       __func__, nArea);
+                                       __func__, area);
                        } else {
-                               pPages = pTA->pages;    /*  save page address list */
-                               nPages = pTA->n_pages;  /*  and page count */
-                               if (pTA->event_sz)      /*  if events flagging in use */
-                                       wake_up_interruptible(&pTA->event);     /*  release anything that was waiting */
+                               pages = ta->pages; /* save page address list */
+                               n_pages = ta->n_pages;  /* and page count */
+                               if (ta->event_sz)/* if events flagging in use */
+                                       /* release anything that was waiting */
+                                       wake_up_interruptible(&ta->event);
 
                                if (ced->xfer_waiting
-                                   && (ced->dma_info.ident == nArea))
-                                       ced->xfer_waiting = false; /* Cannot have pending xfer if area cleared */
-
-                               /*  Clean out the struct transarea except for the wait queue, which is at the end */
-                               /*  This sets used to false and event_sz to 0 to say area not used and no events. */
-                               memset(pTA, 0,
+                                   && (ced->dma_info.ident == area))
+                                       /* Cannot have pending xfer if */
+                                       /* area cleared                */
+                                       ced->xfer_waiting = false;
+
+                               /* Clean out the struct transarea except for */
+                               /* the wait queue, which is at the end. This */
+                               /* sets used to false and event_sz to 0 to   */
+                               /* say area not used and no events.          */
+                               memset(ta, 0,
                                       sizeof(struct transarea) -
                                       sizeof(wait_queue_head_t));
                        }
                        spin_unlock_irq(&ced->staged_lock);
 
-                       if (pPages) {   /*  if we decided to release the memory */
-                               /*  Now we must undo the pinning down of the pages. We will assume the worst and mark */
-                               /*  all the pages as dirty. Don't be tempted to move this up above as you must not be */
-                               /*  holding a spin lock to do this stuff as it is not atomic. */
-                               dev_dbg(&ced->interface->dev, "%s: nPages=%d\n",
-                                       __func__, nPages);
-
-                               for (np = 0; np < nPages; ++np) {
-                                       if (pPages[np]) {
-                                               SetPageDirty(pPages[np]);
-                                               page_cache_release(pPages[np]);
+                       if (pages) { /*  if we decided to release the memory */
+                               /* Now we must undo the pinning down of the  */
+                               /* pages. We will assume the worst and mark  */
+                               /* all the pages as dirty. Don't be tempted  */
+                               /* to move this up above as you must not be  */
+                               /* holding a spin lock to do this stuff as   */
+                               /* it is not atomic.                         */
+                               dev_dbg(&ced->interface->dev,
+                                       "%s: n_pages=%d\n",
+                                       __func__, n_pages);
+
+                               for (np = 0; np < n_pages; ++np) {
+                                       if (pages[np]) {
+                                               SetPageDirty(pages[np]);
+                                               page_cache_release(pages[np]);
                                        }
                                }
 
-                               kfree(pPages);
+                               kfree(pages);
                                dev_dbg(&ced->interface->dev,
-                                       "%s: kfree(pPages) done\n", __func__);
+                                       "%s: kfree(pages) done\n", __func__);
                        }
                }
        }
 
-       return iReturn;
+       return ret;
 }
 
 /****************************************************************************
index fc650c52209153f5961f1d10b89581c5a0fe441b..a5fc387c3820a1cb3b79e4f03749b0915f503ff0 100644 (file)
@@ -221,7 +221,7 @@ extern int ced_read_write_mem(struct ced_data *ced, bool read,
                              unsigned int len);
 
 /*  in ced_ioc.c */
-extern int ced_clear_area(struct ced_data *ced, int nArea);
+extern int ced_clear_area(struct ced_data *ced, int area);
 extern int ced_send_string(struct ced_data *ced, const char __user *data, unsigned int n);
 extern int ced_send_char(struct ced_data *ced, char c);
 extern int ced_get_state(struct ced_data *ced, __u32 *state, __u32 *error);