Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: ced1401: Patch removes typedef unsigned short WORD.

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>

authored by

Elena Ufimtseva and committed by
Greg Kroah-Hartman
4e0825fd 9a054c27

+39 -40
+2 -3
drivers/staging/ced1401/machine.h
··· 82 82 typedef int BOOL; /* To match Windows */ 83 83 typedef char *LPSTR; 84 84 typedef const char *LPCSTR; 85 - typedef unsigned short WORD; 86 85 typedef unsigned int DWORD; 87 86 typedef unsigned char BYTE; 88 87 typedef BYTE BOOLEAN; 89 88 typedef unsigned char UCHAR; 90 89 #define __packed __attribute__((packed)) 91 90 typedef BYTE *LPBYTE; 92 - #define HIWORD(x) (WORD)(((x)>>16) & 0xffff) 93 - #define LOWORD(x) (WORD)((x) & 0xffff) 91 + #define HIWORD(x) (unsigned short)(((x)>>16) & 0xffff) 92 + #define LOWORD(x) (unsigned short)((x) & 0xffff) 94 93 #endif 95 94 96 95 #ifdef _IS_WINDOWS_
+13 -13
drivers/staging/ced1401/use1401.h
··· 140 140 141 141 /* Definitions of element sizes for DMA transfers - to allow byte-swapping */ 142 142 #define ESZBYTES 0 /* BYTE element size value */ 143 - #define ESZWORDS 1 /* WORD element size value */ 143 + #define ESZWORDS 1 /* unsigned short element size value */ 144 144 #define ESZLONGS 2 /* long element size value */ 145 145 #define ESZUNKNOWN 0 /* unknown element size value */ 146 146 ··· 210 210 U14API(short) U14Reset1401(short hand); 211 211 U14API(short) U14ForceReset(short hand); 212 212 U14API(short) U14TypeOf1401(short hand); 213 - U14API(short) U14NameOf1401(short hand, char *pBuf, WORD wMax); 213 + U14API(short) U14NameOf1401(short hand, char *pBuf, unsigned short wMax); 214 214 215 215 U14API(short) U14Stat1401(short hand); 216 216 U14API(short) U14CharCount(short hand); 217 217 U14API(short) U14LineCount(short hand); 218 218 219 219 U14API(short) U14SendString(short hand, const char *pString); 220 - U14API(short) U14GetString(short hand, char *pBuffer, WORD wMaxLen); 220 + U14API(short) U14GetString(short hand, char *pBuffer, unsigned short wMaxLen); 221 221 U14API(short) U14SendChar(short hand, char cChar); 222 222 U14API(short) U14GetChar(short hand, char *pcChar); 223 223 224 224 U14API(short) U14LdCmd(short hand, const char *command); 225 225 U14API(DWORD) U14Ld(short hand, const char *vl, const char *str); 226 226 227 - U14API(short) U14SetTransArea(short hand, WORD wArea, void *pvBuff, 227 + U14API(short) U14SetTransArea(short hand, unsigned short wArea, void *pvBuff, 228 228 DWORD dwLength, short eSz); 229 - U14API(short) U14UnSetTransfer(short hand, WORD wArea); 230 - U14API(short) U14SetTransferEvent(short hand, WORD wArea, BOOL bEvent, 229 + U14API(short) U14UnSetTransfer(short hand, unsigned short wArea); 230 + U14API(short) U14SetTransferEvent(short hand, unsigned short wArea, BOOL bEvent, 231 231 BOOL bToHost, DWORD dwStart, DWORD dwLength); 232 - U14API(int) U14TestTransferEvent(short hand, WORD wArea); 233 - U14API(int) U14WaitTransferEvent(short hand, WORD wArea, int msTimeOut); 232 + U14API(int) U14TestTransferEvent(short hand, unsigned short wArea); 233 + U14API(int) U14WaitTransferEvent(short hand, unsigned short wArea, int msTimeOut); 234 234 U14API(short) U14GetTransfer(short hand, TGET_TX_BLOCK *pTransBlock); 235 235 236 236 U14API(short) U14ToHost(short hand, char *pAddrHost, DWORD dwSize, DWORD dw1401, ··· 238 238 U14API(short) U14To1401(short hand, const char *pAddrHost, DWORD dwSize, DWORD dw1401, 239 239 short eSz); 240 240 241 - U14API(short) U14SetCircular(short hand, WORD wArea, BOOL bToHost, void *pvBuff, 241 + U14API(short) U14SetCircular(short hand, unsigned short wArea, BOOL bToHost, void *pvBuff, 242 242 DWORD dwLength); 243 243 244 - U14API(int) U14GetCircBlk(short hand, WORD wArea, DWORD *pdwOffs); 245 - U14API(int) U14FreeCircBlk(short hand, WORD wArea, DWORD dwOffs, DWORD dwSize, 244 + U14API(int) U14GetCircBlk(short hand, unsigned short wArea, DWORD *pdwOffs); 245 + U14API(int) U14FreeCircBlk(short hand, unsigned short wArea, DWORD dwOffs, DWORD dwSize, 246 246 DWORD *pdwOffs); 247 247 248 248 U14API(short) U14StrToLongs(const char *pszBuff, U14LONG *palNums, short sMaxLongs); ··· 254 254 U14API(int) U14BaseAddr1401(short hand); 255 255 U14API(int) U14DriverVersion(short hand); 256 256 U14API(int) U14DriverType(short hand); 257 - U14API(short) U14DriverName(short hand, char *pBuf, WORD wMax); 257 + U14API(short) U14DriverName(short hand, char *pBuf, unsigned short wMax); 258 258 U14API(short) U14GetUserMemorySize(short hand, DWORD *pMemorySize); 259 259 U14API(short) U14KillIO1401(short hand); 260 260 ··· 273 273 U14API(short) U14StartSelfTest(short hand); 274 274 U14API(short) U14CheckSelfTest(short hand, U14LONG *pData); 275 275 U14API(short) U14TransferFlags(short hand); 276 - U14API(void) U14GetErrorString(short nErr, char *pStr, WORD wMax); 276 + U14API(void) U14GetErrorString(short nErr, char *pStr, unsigned short wMax); 277 277 U14API(int) U14MonitorRev(short hand); 278 278 U14API(void) U14CloseAll(void); 279 279
+3 -3
drivers/staging/ced1401/use14_ioc.h
··· 278 278 279 279 typedef struct TransferDesc /* Structure and type for SetTransArea */ 280 280 { 281 - WORD wArea; /* number of transfer area to set up */ 281 + unsigned short wArea; /* number of transfer area to set up */ 282 282 void FAR *lpvBuff; /* address of transfer area */ 283 283 DWORD dwLength; /* length of area to set up */ 284 284 short eSize; /* size to move (for swapping on MAC) */ ··· 289 289 /* This is the structure used to set up a transfer area */ 290 290 typedef struct VXTransferDesc /* use1401.c and use1432x.x use only */ 291 291 { 292 - WORD wArea; /* number of transfer area to set up */ 293 - WORD wAddrSel; /* 16 bit selector for area */ 292 + unsigned short wArea; /* number of transfer area to set up */ 293 + unsigned short wAddrSel; /* 16 bit selector for area */ 294 294 DWORD dwAddrOfs; /* 32 bit offset for area start */ 295 295 DWORD dwLength; /* length of area to set up */ 296 296 } VXTRANSFERDESC;
+21 -21
drivers/staging/ced1401/userspace/use1401.c
··· 276 276 typedef struct CmdHead // defines header block on command 277 277 { // for PC commands 278 278 char acBasic[5]; // BASIC information - needed to align things 279 - WORD wBasicSz; // size as seen by BASIC 280 - WORD wCmdSize; // size of the following info 279 + unsigned short wBasicSz; // size as seen by BASIC 280 + unsigned short wCmdSize; // size of the following info 281 281 } __packed CMDHEAD; 282 282 #pragma pack() // back to normal 283 283 ··· 455 455 ****************************************************************************/ 456 456 U14API(short) U14StrToLongs(const char* pszBuff, U14LONG *palNums, short sMaxLongs) 457 457 { 458 - WORD wChInd = 0; // index into source 458 + unsigned short wChInd = 0; // index into source 459 459 short sLgInd = 0; // index into result longs 460 460 461 461 while (pszBuff[wChInd] && // until we get to end of string... ··· 681 681 ** U14DriverName 682 682 ** Returns the driver type as 3 character (ISA, PCI, USB or HSS)) 683 683 ****************************************************************************/ 684 - U14API(short) U14DriverName(short hand, char* pBuf, WORD wMax) 684 + U14API(short) U14DriverName(short hand, char* pBuf, unsigned short wMax) 685 685 { 686 686 char* pName; 687 687 *pBuf = 0; // Start off with a blank string ··· 1061 1061 ** U14NameOf1401 1062 1062 ** Returns the type of the 1401 as a string, blank if unknown 1063 1063 ****************************************************************************/ 1064 - U14API(short) U14NameOf1401(short hand, char* pBuf, WORD wMax) 1064 + U14API(short) U14NameOf1401(short hand, char* pBuf, unsigned short wMax) 1065 1065 { 1066 1066 short sErr = CheckHandle(hand); 1067 1067 if (sErr == U14ERR_NOERROR) ··· 1454 1454 U14Reset1401(hand); // in case an active transfer running 1455 1455 for (j = 0; j < MAX_TRANSAREAS; ++j) // Locate locked areas 1456 1456 if (iAreaMask & (1 << j)) // And kill off any transfers 1457 - U14UnSetTransfer(hand, (WORD)j); 1457 + U14UnSetTransfer(hand, (unsigned short)j); 1458 1458 } 1459 1459 1460 1460 #ifdef _IS_WINDOWS_ ··· 1697 1697 ** error code. Any error from the device causes us to set up for 1698 1698 ** a full reset. 1699 1699 ****************************************************************************/ 1700 - U14API(short) U14GetString(short hand, char* pBuffer, WORD wMaxLen) 1700 + U14API(short) U14GetString(short hand, char* pBuffer, unsigned short wMaxLen) 1701 1701 { 1702 1702 short sErr = CheckHandle(hand); 1703 1703 if (sErr != U14ERR_NOERROR) // If an error... ··· 1727 1727 if (asLastRetCode[hand] == U14ERR_NOERROR) /* all ok so far */ 1728 1728 { 1729 1729 DWORD dwBytes = 0; 1730 - *((WORD *)pBuffer) = wMaxLen; /* set up length */ 1730 + *((unsigned short *)pBuffer) = wMaxLen; /* set up length */ 1731 1731 #ifndef _WIN64 1732 1732 if (!USE_NT_DIOC(hand)) /* Win 95 DIOC here ? */ 1733 1733 { ··· 1737 1737 if (wMaxLen > MAXSTRLEN) /* Truncate length */ 1738 1738 wMaxLen = MAXSTRLEN; 1739 1739 1740 - *((WORD *)tstr) = wMaxLen; /* set len */ 1740 + *((unsigned short *)tstr) = wMaxLen; /* set len */ 1741 1741 1742 1742 iOK = DeviceIoControl(aHand1401[hand],(DWORD)U14_GETSTRING, 1743 1743 NULL, 0, tstr, wMaxLen+sizeof(short), ··· 1946 1946 ** other functions after getting an error and before using 1947 1947 ** this function. 1948 1948 ****************************************************************************/ 1949 - U14API(void) U14GetErrorString(short nErr, char* pStr, WORD wMax) 1949 + U14API(void) U14GetErrorString(short nErr, char* pStr, unsigned short wMax) 1950 1950 { 1951 1951 char wstr[150]; 1952 1952 ··· 2105 2105 break; 2106 2106 2107 2107 } 2108 - if ((WORD)strlen(wstr) >= wMax-1) /* Check for string being too long */ 2108 + if ((unsigned short)strlen(wstr) >= wMax-1) /* Check for string being too long */ 2109 2109 wstr[wMax-1] = 0; /* and truncate it if so */ 2110 2110 strcpy(pStr, wstr); /* Return the error string */ 2111 2111 } ··· 2200 2200 ** U14UnSetTransfer Cancels a transfer area 2201 2201 ** wArea The index of a block previously used in by SetTransfer 2202 2202 *****************************************************************************/ 2203 - U14API(short) U14UnSetTransfer(short hand, WORD wArea) 2203 + U14API(short) U14UnSetTransfer(short hand, unsigned short wArea) 2204 2204 { 2205 2205 short sErr = CheckHandle(hand); 2206 2206 #ifdef _IS_WINDOWS_ ··· 2223 2223 2224 2224 /**************************************************************************** 2225 2225 ** U14SetTransArea Sets an area up to be used for transfers 2226 - ** WORD wArea The area number to set up 2226 + ** unsigned short wArea The area number to set up 2227 2227 ** void *pvBuff The address of the buffer for the data. 2228 2228 ** DWORD dwLength The length of the buffer for the data 2229 2229 ** short eSz The element size (used for byte swapping on the Mac) 2230 2230 ****************************************************************************/ 2231 - U14API(short) U14SetTransArea(short hand, WORD wArea, void *pvBuff, 2231 + U14API(short) U14SetTransArea(short hand, unsigned short wArea, void *pvBuff, 2232 2232 DWORD dwLength, short eSz) 2233 2233 { 2234 2234 TRANSFERDESC td; ··· 2344 2344 ** Returns 1 if an event handle exists, 0 if all OK and no event handle or 2345 2345 ** a negative code for an error. 2346 2346 ****************************************************************************/ 2347 - U14API(short) U14SetTransferEvent(short hand, WORD wArea, BOOL bEvent, 2347 + U14API(short) U14SetTransferEvent(short hand, unsigned short wArea, BOOL bEvent, 2348 2348 BOOL bToHost, DWORD dwStart, DWORD dwLength) 2349 2349 { 2350 2350 #ifdef _IS_WINDOWS_ ··· 2416 2416 ** Would a U14WaitTransferEvent() call return immediately? return 1 if so, 2417 2417 ** 0 if not or a negative code if a problem. 2418 2418 ****************************************************************************/ 2419 - U14API(int) U14TestTransferEvent(short hand, WORD wArea) 2419 + U14API(int) U14TestTransferEvent(short hand, unsigned short wArea) 2420 2420 { 2421 2421 #ifdef _IS_WINDOWS_ 2422 2422 int iErr = CheckHandle(hand); ··· 2441 2441 ** Returns If no event handle then return immediately. Else return 1 if 2442 2442 ** timed out or 0=event, and a negative code if a problem. 2443 2443 ****************************************************************************/ 2444 - U14API(int) U14WaitTransferEvent(short hand, WORD wArea, int msTimeOut) 2444 + U14API(int) U14WaitTransferEvent(short hand, unsigned short wArea, int msTimeOut) 2445 2445 { 2446 2446 #ifdef _IS_WINDOWS_ 2447 2447 int iErr = CheckHandle(hand); ··· 2466 2466 2467 2467 /**************************************************************************** 2468 2468 ** U14SetCircular Sets an area up for circular DMA transfers 2469 - ** WORD wArea The area number to set up 2469 + ** unsigned short wArea The area number to set up 2470 2470 ** BOOL bToHost Sets the direction of data transfer 2471 2471 ** void *pvBuff The address of the buffer for the data 2472 2472 ** DWORD dwLength The length of the buffer for the data 2473 2473 ****************************************************************************/ 2474 - U14API(short) U14SetCircular(short hand, WORD wArea, BOOL bToHost, 2474 + U14API(short) U14SetCircular(short hand, unsigned short wArea, BOOL bToHost, 2475 2475 void *pvBuff, DWORD dwLength) 2476 2476 { 2477 2477 short sErr = CheckHandle(hand); ··· 2542 2542 ** Function GetCircBlk returns the size (& start offset) of the next 2543 2543 ** available block of circular data. 2544 2544 ****************************************************************************/ 2545 - U14API(int) U14GetCircBlk(short hand, WORD wArea, DWORD *pdwOffs) 2545 + U14API(int) U14GetCircBlk(short hand, unsigned short wArea, DWORD *pdwOffs) 2546 2546 { 2547 2547 int lErr = CheckHandle(hand); 2548 2548 if (lErr != U14ERR_NOERROR) ··· 2591 2591 ** resuse for circular transfers and returns the size (& start 2592 2592 ** offset) of the next available block of circular data. 2593 2593 ****************************************************************************/ 2594 - U14API(int) U14FreeCircBlk(short hand, WORD wArea, DWORD dwOffs, DWORD dwSize, 2594 + U14API(int) U14FreeCircBlk(short hand, unsigned short wArea, DWORD dwOffs, DWORD dwSize, 2595 2595 DWORD *pdwOffs) 2596 2596 { 2597 2597 int lErr = CheckHandle(hand);