From: Luca Ellero Date: Thu, 10 Jul 2014 09:01:48 +0000 (+0200) Subject: staging: ced1401: rename members of struct circ_blk X-Git-Tag: v4.14-rc1~7109^2~1023 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=077e02d0395715a14c928ddf7037eb551e85777a;p=platform%2Fkernel%2Flinux-rpi.git staging: ced1401: rename members of struct circ_blk Rename members with CamelCase and Hungarian notation Signed-off-by: Luca Ellero Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c index 9821121..20acda2 100644 --- a/drivers/staging/ced1401/ced_ioc.c +++ b/drivers/staging/ced1401/ced_ioc.c @@ -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; } diff --git a/drivers/staging/ced1401/usb1401.c b/drivers/staging/ced1401/usb1401.c index 83c608c..0d3abc2 100644 --- a/drivers/staging/ced1401/usb1401.c +++ b/drivers/staging/ced1401/usb1401.c @@ -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 */ } } diff --git a/drivers/staging/ced1401/usb1401.h b/drivers/staging/ced1401/usb1401.h index c4b562f..d93875b 100644 --- a/drivers/staging/ced1401/usb1401.h +++ b/drivers/staging/ced1401/usb1401.h @@ -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 */