]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
Staging: ced1401: Patch removes typedef unsigned short WORD.
authorElena Ufimtseva <ufimtseva@gmail.com>
Thu, 16 May 2013 16:47:05 +0000 (12:47 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2013 23:33:16 +0000 (16:33 -0700)
Patch removes the use of typedef unsigned short WORD.

Signed-off-by: Elena Ufimtseva <ufimtseva@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ced1401/machine.h
drivers/staging/ced1401/use1401.h
drivers/staging/ced1401/use14_ioc.h
drivers/staging/ced1401/userspace/use1401.c

index 57c915519e8f612c9b089d9ba410e8a655b48823..176e1c9ccd45327e66de948d65c27bbbe09e8b96 100644 (file)
        typedef int BOOL;       /*  To match Windows */
        typedef char *LPSTR;
        typedef const char *LPCSTR;
-       typedef unsigned short WORD;
        typedef unsigned int  DWORD;
        typedef unsigned char  BYTE;
        typedef BYTE  BOOLEAN;
        typedef unsigned char UCHAR;
        #define __packed __attribute__((packed))
        typedef BYTE *LPBYTE;
-       #define HIWORD(x) (WORD)(((x)>>16) & 0xffff)
-       #define LOWORD(x) (WORD)((x) & 0xffff)
+       #define HIWORD(x) (unsigned short)(((x)>>16) & 0xffff)
+       #define LOWORD(x) (unsigned short)((x) & 0xffff)
 #endif
 
 #ifdef _IS_WINDOWS_
index 80213ef7ab8b56d14334694886f55f71019e6179..edf53c1de94a392dbc2b68a9a9f66c0fbeb4f418 100644 (file)
 
 /* Definitions of element sizes for DMA transfers - to allow byte-swapping */
 #define ESZBYTES              0           /* BYTE element size value        */
-#define ESZWORDS              1           /* WORD element size value        */
+#define ESZWORDS              1           /* unsigned short element size value        */
 #define ESZLONGS              2           /* long element size value        */
 #define ESZUNKNOWN            0           /* unknown element size value     */
 
@@ -210,27 +210,27 @@ U14API(short)     U14Close1401(short hand);
 U14API(short)  U14Reset1401(short hand);
 U14API(short)  U14ForceReset(short hand);
 U14API(short)  U14TypeOf1401(short hand);
-U14API(short)  U14NameOf1401(short hand, char *pBuf, WORD wMax);
+U14API(short)  U14NameOf1401(short hand, char *pBuf, unsigned short wMax);
 
 U14API(short)  U14Stat1401(short hand);
 U14API(short)  U14CharCount(short hand);
 U14API(short)  U14LineCount(short hand);
 
 U14API(short)  U14SendString(short hand, const char *pString);
-U14API(short)  U14GetString(short hand, char *pBuffer, WORD wMaxLen);
+U14API(short)  U14GetString(short hand, char *pBuffer, unsigned short wMaxLen);
 U14API(short)  U14SendChar(short hand, char cChar);
 U14API(short)  U14GetChar(short hand, char *pcChar);
 
 U14API(short)  U14LdCmd(short hand, const char *command);
 U14API(DWORD) U14Ld(short hand, const char *vl, const char *str);
 
-U14API(short)  U14SetTransArea(short hand, WORD wArea, void *pvBuff,
+U14API(short)  U14SetTransArea(short hand, unsigned short wArea, void *pvBuff,
                                        DWORD dwLength, short eSz);
-U14API(short)  U14UnSetTransfer(short hand, WORD wArea);
-U14API(short)  U14SetTransferEvent(short hand, WORD wArea, BOOL bEvent,
+U14API(short)  U14UnSetTransfer(short hand, unsigned short wArea);
+U14API(short)  U14SetTransferEvent(short hand, unsigned short wArea, BOOL bEvent,
                                        BOOL bToHost, DWORD dwStart, DWORD dwLength);
-U14API(int)   U14TestTransferEvent(short hand, WORD wArea);
-U14API(int)   U14WaitTransferEvent(short hand, WORD wArea, int msTimeOut);
+U14API(int)   U14TestTransferEvent(short hand, unsigned short wArea);
+U14API(int)   U14WaitTransferEvent(short hand, unsigned short wArea, int msTimeOut);
 U14API(short)  U14GetTransfer(short hand, TGET_TX_BLOCK *pTransBlock);
 
 U14API(short)  U14ToHost(short hand, char *pAddrHost, DWORD dwSize, DWORD dw1401,
@@ -238,11 +238,11 @@ U14API(short)     U14ToHost(short hand, char *pAddrHost, DWORD dwSize, DWORD dw1401,
 U14API(short)  U14To1401(short hand, const char *pAddrHost, DWORD dwSize, DWORD dw1401,
                                                                short eSz);
 
-U14API(short)  U14SetCircular(short hand, WORD wArea, BOOL bToHost, void *pvBuff,
+U14API(short)  U14SetCircular(short hand, unsigned short wArea, BOOL bToHost, void *pvBuff,
                                                        DWORD dwLength);
 
-U14API(int)   U14GetCircBlk(short hand, WORD wArea, DWORD *pdwOffs);
-U14API(int)   U14FreeCircBlk(short hand, WORD wArea, DWORD dwOffs, DWORD dwSize,
+U14API(int)   U14GetCircBlk(short hand, unsigned short wArea, DWORD *pdwOffs);
+U14API(int)   U14FreeCircBlk(short hand, unsigned short wArea, DWORD dwOffs, DWORD dwSize,
                                                        DWORD *pdwOffs);
 
 U14API(short)  U14StrToLongs(const char *pszBuff, U14LONG *palNums, short sMaxLongs);
@@ -254,7 +254,7 @@ U14API(short)       U14OutBufSpace(short hand);
 U14API(int)   U14BaseAddr1401(short hand);
 U14API(int)   U14DriverVersion(short hand);
 U14API(int)   U14DriverType(short hand);
-U14API(short)  U14DriverName(short hand, char *pBuf, WORD wMax);
+U14API(short)  U14DriverName(short hand, char *pBuf, unsigned short wMax);
 U14API(short)  U14GetUserMemorySize(short hand, DWORD *pMemorySize);
 U14API(short)  U14KillIO1401(short hand);
 
@@ -273,7 +273,7 @@ U14API(short)       U14GetDebugData(short hand, U14LONG *plValue);
 U14API(short)  U14StartSelfTest(short hand);
 U14API(short)  U14CheckSelfTest(short hand, U14LONG *pData);
 U14API(short)  U14TransferFlags(short hand);
-U14API(void)  U14GetErrorString(short nErr, char *pStr, WORD wMax);
+U14API(void)  U14GetErrorString(short nErr, char *pStr, unsigned short wMax);
 U14API(int)   U14MonitorRev(short hand);
 U14API(void)  U14CloseAll(void);
 
index a2f6e6e8e38a1466bcd90134408d80a7d75c62f4..33281c434609542590a0a656e2d70aa6cdab2180 100644 (file)
@@ -278,7 +278,7 @@ typedef PARAMBLK*   PPARAMBLK;
 
 typedef struct TransferDesc          /* Structure and type for SetTransArea */
 {
-       WORD        wArea;            /* number of transfer area to set up       */
+       unsigned short        wArea;            /* number of transfer area to set up       */
        void FAR *lpvBuff;          /* address of transfer area                */
        DWORD       dwLength;         /* length of area to set up                */
        short       eSize;            /* size to move (for swapping on MAC)      */
@@ -289,8 +289,8 @@ 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       */
 {
-       WORD        wArea;            /* number of transfer area to set up       */
-       WORD        wAddrSel;         /* 16 bit selector for area                */
+       unsigned short        wArea;            /* number of transfer area to set up       */
+       unsigned short        wAddrSel;         /* 16 bit selector for area                */
        DWORD       dwAddrOfs;        /* 32 bit offset for area start            */
        DWORD       dwLength;         /* length of area to set up                */
 } VXTRANSFERDESC;
index 38e7c1c82d43d7b1fc7de392c7fad47aef9e295e..375438e6c3a5af0887a92cfc844356bdb662080c 100644 (file)
@@ -276,8 +276,8 @@ static int aHand1401[MAX1401] = {0};    // handles for 1401s
 typedef struct CmdHead          // defines header block on command
 {                               // for PC commands
    char   acBasic[5];           // BASIC information - needed to align things
-   WORD   wBasicSz;             // size as seen by BASIC
-   WORD   wCmdSize;             // size of the following info
+   unsigned short   wBasicSz;             // size as seen by BASIC
+   unsigned short   wCmdSize;             // size of the following info
 } __packed CMDHEAD;
 #pragma pack()                  // back to normal
 
@@ -455,7 +455,7 @@ static void TranslateString(char* pStr)
 ****************************************************************************/
 U14API(short) U14StrToLongs(const char* pszBuff, U14LONG *palNums, short sMaxLongs)
 {
-    WORD wChInd = 0;                // index into source
+    unsigned short wChInd = 0;                // index into source
     short sLgInd = 0;               // index into result longs
 
     while (pszBuff[wChInd] &&       // until we get to end of string...
@@ -681,7 +681,7 @@ U14API(int) U14DriverType(short hand)
 ** U14DriverName
 ** Returns the driver type as 3 character (ISA, PCI, USB or HSS))
 ****************************************************************************/
-U14API(short) U14DriverName(short hand, char* pBuf, WORD wMax)
+U14API(short) U14DriverName(short hand, char* pBuf, unsigned short wMax)
 {
     char* pName;
     *pBuf = 0;                             // Start off with a blank string
@@ -1061,7 +1061,7 @@ U14API(short) U14TypeOf1401(short hand)
 ** U14NameOf1401
 ** Returns the type of the 1401 as a string, blank if unknown
 ****************************************************************************/
-U14API(short) U14NameOf1401(short hand, char* pBuf, WORD wMax)
+U14API(short) U14NameOf1401(short hand, char* pBuf, unsigned short wMax)
 {
     short sErr = CheckHandle(hand);
     if (sErr == U14ERR_NOERROR)
@@ -1454,7 +1454,7 @@ U14API(short) U14Close1401(short hand)
         U14Reset1401(hand);                     // in case an active transfer running
         for (j = 0; j < MAX_TRANSAREAS; ++j)    // Locate locked areas
             if (iAreaMask & (1 << j))           // And kill off any transfers
-                U14UnSetTransfer(hand, (WORD)j);
+                U14UnSetTransfer(hand, (unsigned short)j);
     }
 
 #ifdef _IS_WINDOWS_
@@ -1697,7 +1697,7 @@ U14API(short) U14SendChar(short hand, char cChar)
 **          error code. Any error from the device causes us to set up for
 **          a full reset.
 ****************************************************************************/
-U14API(short) U14GetString(short hand, char* pBuffer, WORD wMaxLen)
+U14API(short) U14GetString(short hand, char* pBuffer, unsigned short wMaxLen)
 {
     short sErr = CheckHandle(hand);
     if (sErr != U14ERR_NOERROR)             // If an error...
@@ -1727,7 +1727,7 @@ U14API(short) U14GetString(short hand, char* pBuffer, WORD wMaxLen)
             if (asLastRetCode[hand] == U14ERR_NOERROR)     /* all ok so far */
             {
                 DWORD       dwBytes = 0;
-                *((WORD *)pBuffer) = wMaxLen;       /* set up length */
+                *((unsigned short *)pBuffer) = wMaxLen;       /* set up length */
 #ifndef _WIN64
                 if (!USE_NT_DIOC(hand))             /* Win 95 DIOC here ? */
                 {
@@ -1737,7 +1737,7 @@ U14API(short) U14GetString(short hand, char* pBuffer, WORD wMaxLen)
                     if (wMaxLen > MAXSTRLEN)        /* Truncate length */
                         wMaxLen = MAXSTRLEN;    
 
-                    *((WORD *)tstr) = wMaxLen;      /* set len */
+                    *((unsigned short *)tstr) = wMaxLen;      /* set len */
 
                     iOK = DeviceIoControl(aHand1401[hand],(DWORD)U14_GETSTRING,
                                     NULL, 0, tstr, wMaxLen+sizeof(short),
@@ -1946,7 +1946,7 @@ U14API(short) U14LineCount(short hand)
 **       other functions after getting an error and before using
 **       this function.
 ****************************************************************************/
-U14API(void)  U14GetErrorString(short nErr, char* pStr, WORD wMax)
+U14API(void)  U14GetErrorString(short nErr, char* pStr, unsigned short wMax)
 {
     char    wstr[150];
 
@@ -2105,7 +2105,7 @@ U14API(void)  U14GetErrorString(short nErr, char* pStr, WORD wMax)
         break;
 
     }
-    if ((WORD)strlen(wstr) >= wMax-1)  /* Check for string being too long */
+    if ((unsigned short)strlen(wstr) >= wMax-1)  /* Check for string being too long */
         wstr[wMax-1] = 0;                          /* and truncate it if so */
     strcpy(pStr, wstr);                       /* Return the error string */
 }
@@ -2200,7 +2200,7 @@ U14API(short) U14WorkingSet(DWORD dwMinKb, DWORD dwMaxKb)
 ** U14UnSetTransfer  Cancels a transfer area
 ** wArea    The index of a block previously used in by SetTransfer
 *****************************************************************************/
-U14API(short) U14UnSetTransfer(short hand, WORD wArea)
+U14API(short) U14UnSetTransfer(short hand, unsigned short wArea)
 {
     short sErr = CheckHandle(hand);
 #ifdef _IS_WINDOWS_
@@ -2223,12 +2223,12 @@ U14API(short) U14UnSetTransfer(short hand, WORD wArea)
 
 /****************************************************************************
 ** U14SetTransArea      Sets an area up to be used for transfers
-** WORD  wArea     The area number to set up
+** unsigned short  wArea     The area number to set up
 ** void *pvBuff    The address of the buffer for the data.
 ** DWORD dwLength  The length of the buffer for the data
 ** short eSz       The element size (used for byte swapping on the Mac)
 ****************************************************************************/
-U14API(short) U14SetTransArea(short hand, WORD wArea, void *pvBuff,
+U14API(short) U14SetTransArea(short hand, unsigned short wArea, void *pvBuff,
                                           DWORD dwLength, short eSz)
 {
     TRANSFERDESC td;
@@ -2344,7 +2344,7 @@ U14API(short) U14SetTransArea(short hand, WORD wArea, void *pvBuff,
 ** Returns 1 if an event handle exists, 0 if all OK and no event handle or
 ** a negative code for an error.
 ****************************************************************************/
-U14API(short) U14SetTransferEvent(short hand, WORD wArea, BOOL bEvent,
+U14API(short) U14SetTransferEvent(short hand, unsigned short wArea, BOOL bEvent,
                                   BOOL bToHost, DWORD dwStart, DWORD dwLength)
 {
 #ifdef _IS_WINDOWS_
@@ -2416,7 +2416,7 @@ U14API(short) U14SetTransferEvent(short hand, WORD wArea, BOOL bEvent,
 ** Would a U14WaitTransferEvent() call return immediately? return 1 if so,
 ** 0 if not or a negative code if a problem.
 ****************************************************************************/
-U14API(int) U14TestTransferEvent(short hand, WORD wArea)
+U14API(int) U14TestTransferEvent(short hand, unsigned short wArea)
 {
 #ifdef _IS_WINDOWS_
     int iErr = CheckHandle(hand);
@@ -2441,7 +2441,7 @@ U14API(int) U14TestTransferEvent(short hand, WORD wArea)
 ** Returns   If no event handle then return immediately. Else return 1 if
 **           timed out or 0=event, and a negative code if a problem.
 ****************************************************************************/
-U14API(int) U14WaitTransferEvent(short hand, WORD wArea, int msTimeOut)
+U14API(int) U14WaitTransferEvent(short hand, unsigned short wArea, int msTimeOut)
 {
 #ifdef _IS_WINDOWS_
     int iErr = CheckHandle(hand);
@@ -2466,12 +2466,12 @@ U14API(int) U14WaitTransferEvent(short hand, WORD wArea, int msTimeOut)
 
 /****************************************************************************
 ** U14SetCircular    Sets an area up for circular DMA transfers
-** WORD  wArea          The area number to set up
+** unsigned short  wArea          The area number to set up
 ** BOOL  bToHost        Sets the direction of data transfer
 ** void *pvBuff        The address of the buffer for the data
 ** DWORD dwLength       The length of the buffer for the data
 ****************************************************************************/
-U14API(short) U14SetCircular(short hand, WORD wArea, BOOL bToHost,
+U14API(short) U14SetCircular(short hand, unsigned short wArea, BOOL bToHost,
                                                                        void *pvBuff, DWORD dwLength)
 {
     short sErr = CheckHandle(hand);
@@ -2542,7 +2542,7 @@ U14API(short) U14SetCircular(short hand, WORD wArea, BOOL bToHost,
 ** Function  GetCircBlk returns the size (& start offset) of the next
 **           available block of circular data.
 ****************************************************************************/
-U14API(int) U14GetCircBlk(short hand, WORD wArea, DWORD *pdwOffs)
+U14API(int) U14GetCircBlk(short hand, unsigned short wArea, DWORD *pdwOffs)
 {
     int lErr = CheckHandle(hand);
     if (lErr != U14ERR_NOERROR)
@@ -2591,7 +2591,7 @@ U14API(int) U14GetCircBlk(short hand, WORD wArea, DWORD *pdwOffs)
 **           resuse for circular transfers and returns the size (& start
 **           offset) of the next available block of circular data.
 ****************************************************************************/
-U14API(int) U14FreeCircBlk(short hand, WORD wArea, DWORD dwOffs, DWORD dwSize,
+U14API(int) U14FreeCircBlk(short hand, unsigned short wArea, DWORD dwOffs, DWORD dwSize,
                                         DWORD *pdwOffs)
 {
     int lErr = CheckHandle(hand);