Rename members with CamelCase and Hungarian notation Signed-off-by: Luca Ellero <luca.ellero@xxxxxxxxxxxxxxxx> --- drivers/staging/ced1401/ced_ioc.c | 46 +++++++++++------------ drivers/staging/ced1401/usb1401.c | 74 ++++++++++++++++++------------------- drivers/staging/ced1401/usb1401.h | 4 +- 3 files changed, 62 insertions(+), 62 deletions(-) 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 a7eb55b..fb6aade 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 */ -- 1.7.10.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel