diff options
author | Monam Agarwal <monamagarwal123@gmail.com> | 2014-03-19 01:06:35 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-18 13:30:26 -0700 |
commit | 5f3ccfcf2cb6b3d48aa34b56546df296cb2e22b7 (patch) | |
tree | 00efb10da0c8298949de7d2cc4057effafffc61b | |
parent | 90ae9d4473162872647ed016e326d27b120e168b (diff) |
Staging: ced1401: Fix typedef warnings in ced_ioctl.h
This patch fixes following checkpatch.pl warnings:
WARNING:do not add new typedefs.
In this patch i have also renamed TransferDesc to transfer_area_desc in order to clearly indicate
that it describes the transfer area.
Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/ced1401/ced_ioc.c | 8 | ||||
-rw-r--r-- | drivers/staging/ced1401/ced_ioctl.h | 13 | ||||
-rw-r--r-- | drivers/staging/ced1401/usb1401.c | 4 | ||||
-rw-r--r-- | drivers/staging/ced1401/usb1401.h | 4 | ||||
-rw-r--r-- | drivers/staging/ced1401/use14_ioc.h | 5 | ||||
-rw-r--r-- | drivers/staging/ced1401/userspace/use1401.c | 10 |
6 files changed, 21 insertions, 23 deletions
diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c index 573a283fb12c..85ab6a34f9ec 100644 --- a/drivers/staging/ced1401/ced_ioc.c +++ b/drivers/staging/ced1401/ced_ioc.c @@ -736,10 +736,10 @@ error: ** unset it. Unsetting will fail if the area is booked, and a transfer to that ** area is in progress. Otherwise, we will release the area and re-assign it. ****************************************************************************/ -int SetTransfer(DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD) +int SetTransfer(DEVICE_EXTENSION *pdx, struct transfer_area_desc __user *pTD) { int iReturn; - TRANSFERDESC td; + struct transfer_area_desc td; if (copy_from_user(&td, pTD, sizeof(td))) return -EFAULT; @@ -1318,11 +1318,11 @@ int DbgStopLoop(DEVICE_EXTENSION *pdx) ** booked and a transfer to that area is in progress. Otherwise, we will ** release the area and re-assign it. ****************************************************************************/ -int SetCircular(DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD) +int SetCircular(DEVICE_EXTENSION *pdx, struct transfer_area_desc __user *pTD) { int iReturn; bool bToHost; - TRANSFERDESC td; + struct transfer_area_desc td; if (copy_from_user(&td, pTD, sizeof(td))) return -EFAULT; diff --git a/drivers/staging/ced1401/ced_ioctl.h b/drivers/staging/ced1401/ced_ioctl.h index fa2c7d6fe79c..12294636392f 100644 --- a/drivers/staging/ced1401/ced_ioctl.h +++ b/drivers/staging/ced1401/ced_ioctl.h @@ -26,14 +26,13 @@ ** TypeDefs *****************************************************************************/ -typedef struct TransferDesc { +struct transfer_area_desc { long long lpvBuff; /* address of transfer area (for 64 or 32 bit) */ unsigned int dwLength; /* length of the area */ unsigned short wAreaNum; /* number of transfer area to set up */ short eSize; /* element size - is tohost flag for circular */ -} TRANSFERDESC; +}; -typedef TRANSFERDESC *LPTRANSFERDESC; typedef struct TransferEvent { unsigned int dwStart; /* offset into the area */ @@ -92,7 +91,7 @@ typedef struct TCSBlock { #define IOCTL_CED_LINECOUNT _IO(CED_MAGIC_IOC, 7) #define IOCTL_CED_GETSTRING(nMax) _IOC(_IOC_READ, CED_MAGIC_IOC, 8, nMax) -#define IOCTL_CED_SETTRANSFER _IOW(CED_MAGIC_IOC, 11, TRANSFERDESC) +#define IOCTL_CED_SETTRANSFER _IOW(CED_MAGIC_IOC, 11, struct transfer_area_desc) #define IOCTL_CED_UNSETTRANSFER _IO(CED_MAGIC_IOC, 12) #define IOCTL_CED_SETEVENT _IOW(CED_MAGIC_IOC, 13, TRANSFEREVENT) #define IOCTL_CED_GETOUTBUFSPACE _IO(CED_MAGIC_IOC, 14) @@ -118,7 +117,7 @@ typedef struct TCSBlock { #define IOCTL_CED_DBGGETDATA _IOR(CED_MAGIC_IOC, 39, TDBGBLOCK) #define IOCTL_CED_DBGSTOPLOOP _IO(CED_MAGIC_IOC, 40) #define IOCTL_CED_FULLRESET _IO(CED_MAGIC_IOC, 41) -#define IOCTL_CED_SETCIRCULAR _IOW(CED_MAGIC_IOC, 42, TRANSFERDESC) +#define IOCTL_CED_SETCIRCULAR _IOW(CED_MAGIC_IOC, 42, struct transfer_area_desc) #define IOCTL_CED_GETCIRCBLOCK _IOWR(CED_MAGIC_IOC, 43, TCIRCBLOCK) #define IOCTL_CED_FREECIRCBLOCK _IOWR(CED_MAGIC_IOC, 44, TCIRCBLOCK) #define IOCTL_CED_WAITEVENT _IO(CED_MAGIC_IOC, 45) @@ -190,7 +189,7 @@ inline int CED_GetDriverRevision(int fh) return ioctl(fh, IOCTL_CED_GETDRIVERREVISION); } -inline int CED_SetTransfer(int fh, TRANSFERDESC *pTD) +inline int CED_SetTransfer(int fh, struct transfer_area_desc *pTD) { return ioctl(fh, IOCTL_CED_SETTRANSFER, pTD); } @@ -291,7 +290,7 @@ inline int CED_FullReset(int fh) return ioctl(fh, IOCTL_CED_FULLRESET); } -inline int CED_SetCircular(int fh, TRANSFERDESC *pTD) +inline int CED_SetCircular(int fh, struct transfer_area_desc *pTD) { return ioctl(fh, IOCTL_CED_SETCIRCULAR, pTD); } diff --git a/drivers/staging/ced1401/usb1401.c b/drivers/staging/ced1401/usb1401.c index c281fdabb4ed..db149aef0446 100644 --- a/drivers/staging/ced1401/usb1401.c +++ b/drivers/staging/ced1401/usb1401.c @@ -1251,7 +1251,7 @@ static long ced_ioctl(struct file *file, unsigned int cmd, unsigned long ulArg) return GetString(pdx, (char __user *)ulArg, _IOC_SIZE(cmd)); case _IOC_NR(IOCTL_CED_SETTRANSFER): - return SetTransfer(pdx, (TRANSFERDESC __user *) ulArg); + return SetTransfer(pdx, (struct transfer_area_desc __user *) ulArg); case _IOC_NR(IOCTL_CED_UNSETTRANSFER): return UnsetTransfer(pdx, (int)ulArg); @@ -1316,7 +1316,7 @@ static long ced_ioctl(struct file *file, unsigned int cmd, unsigned long ulArg) break; case _IOC_NR(IOCTL_CED_SETCIRCULAR): - return SetCircular(pdx, (TRANSFERDESC __user *) ulArg); + return SetCircular(pdx, (struct transfer_area_desc __user *) ulArg); case _IOC_NR(IOCTL_CED_GETCIRCBLOCK): return GetCircBlock(pdx, (TCIRCBLOCK __user *) ulArg); diff --git a/drivers/staging/ced1401/usb1401.h b/drivers/staging/ced1401/usb1401.h index f031e3a2c7cf..4bdd2e09ed0a 100644 --- a/drivers/staging/ced1401/usb1401.h +++ b/drivers/staging/ced1401/usb1401.h @@ -218,7 +218,7 @@ extern bool QuickCheck(DEVICE_EXTENSION *pdx, bool bTestBuff, bool bCanReset); extern int Reset1401(DEVICE_EXTENSION *pdx); extern int GetChar(DEVICE_EXTENSION *pdx); extern int GetString(DEVICE_EXTENSION *pdx, char __user *pUser, int n); -extern int SetTransfer(DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD); +extern int SetTransfer(DEVICE_EXTENSION *pdx, struct transfer_area_desc __user *pTD); extern int UnsetTransfer(DEVICE_EXTENSION *pdx, int nArea); extern int SetEvent(DEVICE_EXTENSION *pdx, TRANSFEREVENT __user *pTE); extern int Stat1401(DEVICE_EXTENSION *pdx); @@ -238,7 +238,7 @@ extern int DbgRampData(DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB); extern int DbgRampAddr(DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB); extern int DbgGetData(DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB); extern int DbgStopLoop(DEVICE_EXTENSION *pdx); -extern int SetCircular(DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD); +extern int SetCircular(DEVICE_EXTENSION *pdx, struct transfer_area_desc __user *pTD); extern int GetCircBlock(DEVICE_EXTENSION *pdx, TCIRCBLOCK __user *pCB); extern int FreeCircBlock(DEVICE_EXTENSION *pdx, TCIRCBLOCK __user *pCB); extern int WaitEvent(DEVICE_EXTENSION *pdx, int nArea, int msTimeOut); diff --git a/drivers/staging/ced1401/use14_ioc.h b/drivers/staging/ced1401/use14_ioc.h index 97d7913840dc..42d2e4e6e9a9 100644 --- a/drivers/staging/ced1401/use14_ioc.h +++ b/drivers/staging/ced1401/use14_ioc.h @@ -276,15 +276,14 @@ typedef struct paramBlk { typedef PARAMBLK* PPARAMBLK; -typedef struct TransferDesc /* Structure and type for SetTransArea */ +struct transfer_area_desc /* Structure and type for SetTransArea */ { unsigned short wArea; /* number of transfer area to set up */ void FAR *lpvBuff; /* address of transfer area */ unsigned int dwLength; /* length of area to set up */ short eSize; /* size to move (for swapping on MAC) */ -} TRANSFERDESC; +}; -typedef TRANSFERDESC FAR *LPTRANSFERDESC; /* This is the structure used to set up a transfer area */ typedef struct VXTransferDesc /* use1401.c and use1432x.x use only */ diff --git a/drivers/staging/ced1401/userspace/use1401.c b/drivers/staging/ced1401/userspace/use1401.c index c9bc2ebfef1a..7b8a2227fe5b 100644 --- a/drivers/staging/ced1401/userspace/use1401.c +++ b/drivers/staging/ced1401/userspace/use1401.c @@ -2231,7 +2231,7 @@ U14API(short) U14UnSetTransfer(short hand, unsigned short wArea) U14API(short) U14SetTransArea(short hand, unsigned short wArea, void *pvBuff, unsigned int dwLength, short eSz) { - TRANSFERDESC td; + struct transfer_area_desc td; short sErr = CheckHandle(hand); if (sErr != U14ERR_NOERROR) return sErr; @@ -2292,7 +2292,7 @@ U14API(short) U14SetTransArea(short hand, unsigned short wArea, void *pvBuff, td.eSize = 0; // Dummy element size if (DeviceIoControl(aHand1401[hand],(unsigned int)U14_SETTRANSFER, - &td,sizeof(TRANSFERDESC), + &td,sizeof(struct transfer_area_desc), &rWork,sizeof(PARAMBLK),&dwBytes,NULL)) { if (dwBytes >= sizeof(PARAMBLK)) // maybe error from driver? @@ -2496,14 +2496,14 @@ U14API(short) U14SetCircular(short hand, unsigned short wArea, BOOL bToHost, { PARAMBLK rWork; unsigned int dwBytes; - TRANSFERDESC txDesc; + struct transfer_area_desc txDesc; txDesc.wArea = wArea; /* Pure NT - put data into struct */ txDesc.lpvBuff = pvBuff; txDesc.dwLength = dwLength; txDesc.eSize = (short)bToHost; /* Use this for direction flag */ if (DeviceIoControl(aHand1401[hand],(unsigned int)U14_SETCIRCULAR, - &txDesc, sizeof(TRANSFERDESC), + &txDesc, sizeof(struct transfer_area_desc), &rWork, sizeof(PARAMBLK),&dwBytes,NULL)) { if (dwBytes >= sizeof(PARAMBLK)) /* error from driver? */ @@ -2528,7 +2528,7 @@ U14API(short) U14SetCircular(short hand, unsigned short wArea, BOOL bToHost, #ifdef LINUX else { - TRANSFERDESC td; + struct transfer_area_desc td; td.lpvBuff = (long long)((unsigned long)pvBuff); td.wAreaNum = wArea; td.dwLength = dwLength; |