staging: ced1401: rename members of struct circ_blk
authorLuca Ellero <luca.ellero@brickedbrain.com>
Thu, 10 Jul 2014 09:01:48 +0000 (11:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2014 22:08:32 +0000 (15:08 -0700)
Rename members with CamelCase and Hungarian notation

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.c
drivers/staging/ced1401/usb1401.h

index 98211215527971f77722bb2a8176cfdff2abf51a..20acda2f2ea819f69addaca9742aaee4ad5743dd 100644 (file)
@@ -710,10 +710,10 @@ static int ced_set_area(struct ced_data *ced, int nArea, char __user *puBuf,
                pTA->bCircular = bCircular;
                pTA->bCircToHost = bCircToHost;
 
-               pTA->aBlocks[0].dwOffset = 0;
-               pTA->aBlocks[0].dwSize = 0;
-               pTA->aBlocks[1].dwOffset = 0;
-               pTA->aBlocks[1].dwSize = 0;
+               pTA->aBlocks[0].offset = 0;
+               pTA->aBlocks[0].size = 0;
+               pTA->aBlocks[1].offset = 0;
+               pTA->aBlocks[1].size = 0;
                pTA->bUsed = true;      /*  This is now a used block */
 
                spin_unlock_irq(&ced->stagedLock);
@@ -1361,9 +1361,9 @@ int ced_get_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB)
 
                if ((pArea->bUsed) && (pArea->bCircular) &&     /*  Must be circular area */
                    (pArea->bCircToHost)) {     /*  For now at least must be to host */
-                       if (pArea->aBlocks[0].dwSize > 0) {     /*  Got anything? */
-                               cb.dwOffset = pArea->aBlocks[0].dwOffset;
-                               cb.dwSize = pArea->aBlocks[0].dwSize;
+                       if (pArea->aBlocks[0].size > 0) {       /*  Got anything? */
+                               cb.dwOffset = pArea->aBlocks[0].offset;
+                               cb.dwSize = pArea->aBlocks[0].size;
                                dev_dbg(&ced->interface->dev,
                                        "%s: return block 0: %d bytes at %d\n",
                                        __func__, cb.dwSize, cb.dwOffset);
@@ -1415,31 +1415,31 @@ int ced_free_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB)
                    (pArea->bCircToHost)) {     /*  For now at least must be to host */
                        bool bWaiting = false;
 
-                       if ((pArea->aBlocks[0].dwSize >= uSize) &&      /*  Got anything? */
-                           (pArea->aBlocks[0].dwOffset == uStart)) {   /*  Must be legal data */
-                               pArea->aBlocks[0].dwSize -= uSize;
-                               pArea->aBlocks[0].dwOffset += uSize;
-                               if (pArea->aBlocks[0].dwSize == 0) {    /*  Have we emptied this block? */
-                                       if (pArea->aBlocks[1].dwSize) { /*  Is there a second block? */
+                       if ((pArea->aBlocks[0].size >= uSize) &&        /*  Got anything? */
+                           (pArea->aBlocks[0].offset == uStart)) {     /*  Must be legal data */
+                               pArea->aBlocks[0].size -= uSize;
+                               pArea->aBlocks[0].offset += uSize;
+                               if (pArea->aBlocks[0].size == 0) {      /*  Have we emptied this block? */
+                                       if (pArea->aBlocks[1].size) {   /*  Is there a second block? */
                                                pArea->aBlocks[0] = pArea->aBlocks[1];  /*  Copy down block 2 data */
-                                               pArea->aBlocks[1].dwSize = 0;   /*  and mark the second block as unused */
-                                               pArea->aBlocks[1].dwOffset = 0;
+                                               pArea->aBlocks[1].size = 0;     /*  and mark the second block as unused */
+                                               pArea->aBlocks[1].offset = 0;
                                        } else
-                                               pArea->aBlocks[0].dwOffset = 0;
+                                               pArea->aBlocks[0].offset = 0;
                                }
 
                                dev_dbg(&ced->interface->dev,
                                        "%s: free %d bytes at %d, return %d bytes at %d, wait=%d\n",
                                        __func__, uSize, uStart,
-                                       pArea->aBlocks[0].dwSize,
-                                       pArea->aBlocks[0].dwOffset,
+                                       pArea->aBlocks[0].size,
+                                       pArea->aBlocks[0].offset,
                                        ced->bXFerWaiting);
 
                                /*  Return the next available block of memory as well */
-                               if (pArea->aBlocks[0].dwSize > 0) {     /*  Got anything? */
+                               if (pArea->aBlocks[0].size > 0) {       /*  Got anything? */
                                        cb.dwOffset =
-                                           pArea->aBlocks[0].dwOffset;
-                                       cb.dwSize = pArea->aBlocks[0].dwSize;
+                                           pArea->aBlocks[0].offset;
+                                       cb.dwSize = pArea->aBlocks[0].size;
                                }
 
                                bWaiting = ced->bXFerWaiting;
@@ -1453,8 +1453,8 @@ int ced_free_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB)
                                dev_err(&ced->interface->dev,
                                        "%s: ERROR: freeing %d bytes at %d, block 0 is %d bytes at %d\n",
                                        __func__, uSize, uStart,
-                                       pArea->aBlocks[0].dwSize,
-                                       pArea->aBlocks[0].dwOffset);
+                                       pArea->aBlocks[0].size,
+                                       pArea->aBlocks[0].offset);
                                iReturn = U14ERR_NOMEMORY;
                        }
 
index 83c608c2b7488b485e012c3578da8a6857771cfe..0d3abc25ce33fd5ba2dfda92b461a59099a37357 100644 (file)
@@ -554,62 +554,62 @@ static void staged_callback(struct urb *pUrb)
                /*   that calculates the offset to use (in ced_read_write_mem) is totally duff. */
                if ((pArea->bCircular) && (pArea->bCircToHost) && (!bCancel) && /*  Time to sort out circular buffer info? */
                    (ced->StagedRead)) {        /*  Only for tohost transfers for now */
-                       if (pArea->aBlocks[1].dwSize > 0) {     /*  If block 1 is in use we must append to it */
+                       if (pArea->aBlocks[1].size > 0) {       /*  If block 1 is in use we must append to it */
                                if (ced->StagedOffset ==
-                                   (pArea->aBlocks[1].dwOffset +
-                                    pArea->aBlocks[1].dwSize)) {
-                                       pArea->aBlocks[1].dwSize +=
+                                   (pArea->aBlocks[1].offset +
+                                    pArea->aBlocks[1].size)) {
+                                       pArea->aBlocks[1].size +=
                                            ced->StagedLength;
                                        dev_dbg(&ced->interface->dev,
                                                "RWM_Complete, circ block 1 now %d bytes at %d\n",
-                                               pArea->aBlocks[1].dwSize,
-                                               pArea->aBlocks[1].dwOffset);
+                                               pArea->aBlocks[1].size,
+                                               pArea->aBlocks[1].offset);
                                } else {
                                        /*  Here things have gone very, very, wrong, but I cannot see how this can actually be achieved */
-                                       pArea->aBlocks[1].dwOffset =
+                                       pArea->aBlocks[1].offset =
                                            ced->StagedOffset;
-                                       pArea->aBlocks[1].dwSize =
+                                       pArea->aBlocks[1].size =
                                            ced->StagedLength;
                                        dev_err(&ced->interface->dev,
                                                "%s: ERROR, circ block 1 re-started %d bytes at %d\n",
                                                __func__,
-                                               pArea->aBlocks[1].dwSize,
-                                               pArea->aBlocks[1].dwOffset);
+                                               pArea->aBlocks[1].size,
+                                               pArea->aBlocks[1].offset);
                                }
                        } else {        /*  If block 1 is not used, we try to add to block 0 */
-                               if (pArea->aBlocks[0].dwSize > 0) {     /*  Got stored block 0 information? */
+                               if (pArea->aBlocks[0].size > 0) {       /*  Got stored block 0 information? */
                                        /*  Must append onto the existing block 0 */
                                        if (ced->StagedOffset ==
-                                           (pArea->aBlocks[0].dwOffset +
-                                            pArea->aBlocks[0].dwSize)) {
-                                               pArea->aBlocks[0].dwSize += ced->StagedLength;  /*  Just add this transfer in */
+                                           (pArea->aBlocks[0].offset +
+                                            pArea->aBlocks[0].size)) {
+                                               pArea->aBlocks[0].size += ced->StagedLength;    /*  Just add this transfer in */
                                                dev_dbg(&ced->interface->dev,
                                                        "RWM_Complete, circ block 0 now %d bytes at %d\n",
                                                        pArea->aBlocks[0].
-                                                       dwSize,
+                                                       size,
                                                        pArea->aBlocks[0].
-                                                       dwOffset);
+                                                       offset);
                                        } else {        /*  If it doesn't append, put into new block 1 */
-                                               pArea->aBlocks[1].dwOffset =
+                                               pArea->aBlocks[1].offset =
                                                    ced->StagedOffset;
-                                               pArea->aBlocks[1].dwSize =
+                                               pArea->aBlocks[1].size =
                                                    ced->StagedLength;
                                                dev_dbg(&ced->interface->dev,
                                                        "RWM_Complete, circ block 1 started %d bytes at %d\n",
                                                        pArea->aBlocks[1].
-                                                       dwSize,
+                                                       size,
                                                        pArea->aBlocks[1].
-                                                       dwOffset);
+                                                       offset);
                                        }
                                } else  { /*  No info stored yet, just save in block 0 */
-                                       pArea->aBlocks[0].dwOffset =
+                                       pArea->aBlocks[0].offset =
                                            ced->StagedOffset;
-                                       pArea->aBlocks[0].dwSize =
+                                       pArea->aBlocks[0].size =
                                            ced->StagedLength;
                                        dev_dbg(&ced->interface->dev,
                                                "RWM_Complete, circ block 0 started %d bytes at %d\n",
-                                               pArea->aBlocks[0].dwSize,
-                                               pArea->aBlocks[0].dwOffset);
+                                               pArea->aBlocks[0].size,
+                                               pArea->aBlocks[0].offset);
                                }
                        }
                }
@@ -628,8 +628,8 @@ static void staged_callback(struct urb *pUrb)
                                    (pArea->bCircToHost)) {     /*  only in supported direction */
                                        /*  Is total data waiting up to size limit? */
                                        unsigned int dwTotal =
-                                           pArea->aBlocks[0].dwSize +
-                                           pArea->aBlocks[1].dwSize;
+                                           pArea->aBlocks[0].size +
+                                           pArea->aBlocks[1].size;
                                        iWakeUp = (dwTotal >= pArea->dwEventSz);
                                } else {
                                        unsigned int transEnd =
@@ -799,22 +799,22 @@ int ced_read_write_mem(struct ced_data *ced, bool Read, unsigned short wIdent,
 
                dev_dbg(&ced->interface->dev,
                        "Circular buffers are %d at %d and %d at %d\n",
-                       pArea->aBlocks[0].dwSize, pArea->aBlocks[0].dwOffset,
-                       pArea->aBlocks[1].dwSize, pArea->aBlocks[1].dwOffset);
-               if (pArea->aBlocks[1].dwSize > 0) {     /*  Using the second block already? */
-                       dwOffs = pArea->aBlocks[1].dwOffset + pArea->aBlocks[1].dwSize; /*  take offset from that */
-                       bWait = (dwOffs + dwLen) > pArea->aBlocks[0].dwOffset;  /*  Wait if will overwrite block 0? */
+                       pArea->aBlocks[0].size, pArea->aBlocks[0].offset,
+                       pArea->aBlocks[1].size, pArea->aBlocks[1].offset);
+               if (pArea->aBlocks[1].size > 0) {       /*  Using the second block already? */
+                       dwOffs = pArea->aBlocks[1].offset + pArea->aBlocks[1].size;     /*  take offset from that */
+                       bWait = (dwOffs + dwLen) > pArea->aBlocks[0].offset;    /*  Wait if will overwrite block 0? */
                        bWait |= (dwOffs + dwLen) > pArea->dwLength;    /*  or if it overflows the buffer */
                } else {                /*  Area 1 not in use, try to use area 0 */
-                       if (pArea->aBlocks[0].dwSize == 0)      /*  Reset block 0 if not in use */
-                               pArea->aBlocks[0].dwOffset = 0;
+                       if (pArea->aBlocks[0].size == 0)        /*  Reset block 0 if not in use */
+                               pArea->aBlocks[0].offset = 0;
                        dwOffs =
-                           pArea->aBlocks[0].dwOffset +
-                           pArea->aBlocks[0].dwSize;
+                           pArea->aBlocks[0].offset +
+                           pArea->aBlocks[0].size;
                        if ((dwOffs + dwLen) > pArea->dwLength) {       /*  Off the end of the buffer? */
-                               pArea->aBlocks[1].dwOffset = 0; /*  Set up to use second block */
+                               pArea->aBlocks[1].offset = 0;   /*  Set up to use second block */
                                dwOffs = 0;
-                               bWait = (dwOffs + dwLen) > pArea->aBlocks[0].dwOffset;  /*  Wait if will overwrite block 0? */
+                               bWait = (dwOffs + dwLen) > pArea->aBlocks[0].offset;    /*  Wait if will overwrite block 0? */
                                bWait |= (dwOffs + dwLen) > pArea->dwLength;    /*  or if it overflows the buffer */
                        }
                }
index c4b562fa6e09132eb5aab6ee0ca7635ad796e118..d93875b689f3ef448496dc8efc31bfb8eb2bf991 100644 (file)
@@ -95,8 +95,8 @@
 /* A structure holding information about a block */
 /* of memory for use in circular transfers       */
 struct circ_blk {
-       volatile UINT dwOffset;   /* Offset within area of block start */
-       volatile UINT dwSize;     /* Size of the block, in bytes (0 = unused) */
+       volatile UINT offset;   /* Offset within area of block start */
+       volatile UINT size;     /* Size of the block, in bytes (0 = unused) */
 };
 
 /*  A structure holding all of the information about a transfer area - an area of */