Staging: ced1401: Fix typedef warnings in ced_ioctl.h
authorMonam Agarwal <monamagarwal123@gmail.com>
Tue, 18 Mar 2014 19:36:35 +0000 (01:06 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Mar 2014 20:30:26 +0000 (13:30 -0700)
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>
drivers/staging/ced1401/ced_ioc.c
drivers/staging/ced1401/ced_ioctl.h
drivers/staging/ced1401/usb1401.c
drivers/staging/ced1401/usb1401.h
drivers/staging/ced1401/use14_ioc.h
drivers/staging/ced1401/userspace/use1401.c

index 573a283fb12c2d5cfddd343814b0eba0b10065e5..85ab6a34f9ec3ff8c442b808d8fd7320849bfc9f 100644 (file)
@@ -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;
index fa2c7d6fe79c0c1905d1769ccda95b86d1d684a2..12294636392f56dfd3a50f6c8dbe62441be8429f 100644 (file)
 ** 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);
 }
index c281fdabb4ed16ca6ddfd80f0692d513a1fbcb16..db149aef04465e26a2dc1024bd066a72e848ae80 100644 (file)
@@ -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);
index f031e3a2c7cf209fbf82188cade39567502d846e..4bdd2e09ed0a118912cc282c704ddb04086d7bf5 100644 (file)
@@ -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);
index 97d7913840dc351e642214a7dc7262e709321262..42d2e4e6e9a9cee1ccde234b44922eebeeb04a00 100644 (file)
@@ -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       */
index c9bc2ebfef1a41478bc2686058bb039531d079d0..7b8a2227fe5b69677d586def6198cd02a075fff0 100644 (file)
@@ -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;