Staging: ced1401: Fixes C pointer format warnings
authorElena Ufimtseva <ufimtseva@gmail.com>
Wed, 15 May 2013 16:57:16 +0000 (12:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 May 2013 17:16:21 +0000 (13:16 -0400)
Fixes checkpatch warnings about C pointer format.

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

index 0895c94..aa68878 100644 (file)
@@ -35,7 +35,7 @@ typedef struct TransferDesc {
        short eSize;            /* element size - is tohost flag for circular */
 } TRANSFERDESC;
 
-typedef TRANSFERDESC * LPTRANSFERDESC;
+typedef TRANSFERDESC *LPTRANSFERDESC;
 
 typedef struct TransferEvent {
        unsigned int dwStart;           /* offset into the area */
index 9f38aa4..2b0ceec 100644 (file)
     #define FAR
 
     typedef int BOOL;       /*  To match Windows */
-    typedef char * LPSTR;
-    typedef const char * LPCSTR;
+    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;
+    typedef BYTE *LPBYTE;
     #define HIWORD(x) (WORD)(((x)>>16) & 0xffff)
     #define LOWORD(x) (WORD)((x) & 0xffff)
 #endif
index 8a0876d..76224ba 100644 (file)
@@ -252,7 +252,7 @@ static int ced_flush(struct file *file, fl_owner_t id)
 ** not help with a device extension held by a file.
 ** return true if can accept new io requests, else false
 */
-static bool CanAcceptIoRequests(DEVICE_EXTENSION * pdx)
+static bool CanAcceptIoRequests(DEVICE_EXTENSION *pdx)
 {
        return pdx && pdx->interface;   /*  Can we accept IO requests */
 }
@@ -339,7 +339,7 @@ static void ced_writechar_callback(struct urb *pUrb)
 ** Transmit the characters in the output buffer to the 1401. This may need
 ** breaking down into multiple transfers.
 ****************************************************************************/
-int SendChars(DEVICE_EXTENSION * pdx)
+int SendChars(DEVICE_EXTENSION *pdx)
 {
        int iReturn = U14ERR_NOERROR;
 
@@ -440,7 +440,7 @@ int SendChars(DEVICE_EXTENSION * pdx)
 ** pdx  Is our device extension which holds all we know about the transfer.
 ** n    The number of bytes to move one way or the other.
 ***************************************************************************/
-static void CopyUserSpace(DEVICE_EXTENSION * pdx, int n)
+static void CopyUserSpace(DEVICE_EXTENSION *pdx, int n)
 {
        unsigned int nArea = pdx->StagedId;
        if (nArea < MAX_TRANSAREAS) {
@@ -495,7 +495,7 @@ static void CopyUserSpace(DEVICE_EXTENSION * pdx, int n)
 }
 
 /*  Forward declarations for stuff used circularly */
-static int StageChunk(DEVICE_EXTENSION * pdx);
+static int StageChunk(DEVICE_EXTENSION *pdx);
 /***************************************************************************
 ** ReadWrite_Complete
 **
@@ -709,7 +709,7 @@ static void staged_callback(struct urb *pUrb)
 ** The calling code must have acquired the staging spinlock before calling
 **  this function, and is responsible for releasing it. We are at callback level.
 ****************************************************************************/
-static int StageChunk(DEVICE_EXTENSION * pdx)
+static int StageChunk(DEVICE_EXTENSION *pdx)
 {
        int iReturn = U14ERR_NOERROR;
        unsigned int ChunkSize;
@@ -772,7 +772,7 @@ static int StageChunk(DEVICE_EXTENSION * pdx)
 **             transfer.
 **    dwLen - the number of bytes to transfer.
 */
-int ReadWriteMem(DEVICE_EXTENSION * pdx, bool Read, unsigned short wIdent,
+int ReadWriteMem(DEVICE_EXTENSION *pdx, bool Read, unsigned short wIdent,
                 unsigned int dwOffs, unsigned int dwLen)
 {
        TRANSAREA *pArea = &pdx->rTransDef[wIdent];     /*  Transfer area info */
@@ -962,7 +962,7 @@ static bool ReadHuff(volatile unsigned int *pDWord, char *pBuf,
 **  we start handling the data at offset zero.
 **
 *****************************************************************************/
-static bool ReadDMAInfo(volatile DMADESC * pDmaDesc, DEVICE_EXTENSION * pdx,
+static bool ReadDMAInfo(volatile DMADESC *pDmaDesc, DEVICE_EXTENSION *pdx,
                        char *pBuf, unsigned int dwCount)
 {
        bool bResult = false;   /*  assume we won't succeed */
@@ -1049,7 +1049,7 @@ static bool ReadDMAInfo(volatile DMADESC * pDmaDesc, DEVICE_EXTENSION * pdx,
 **           this is known to be at least 2 or we will not be called.
 **
 ****************************************************************************/
-static int Handle1401Esc(DEVICE_EXTENSION * pdx, char *pCh,
+static int Handle1401Esc(DEVICE_EXTENSION *pdx, char *pCh,
                         unsigned int dwCount)
 {
        int iReturn = U14ERR_FAIL;
@@ -1182,7 +1182,7 @@ static void ced_readchar_callback(struct urb *pUrb)
 ** we can pick up any inward transfers. This can be called in multiple contexts
 ** so we use the irqsave version of the spinlock.
 ****************************************************************************/
-int Allowi(DEVICE_EXTENSION * pdx)
+int Allowi(DEVICE_EXTENSION *pdx)
 {
        int iReturn = U14ERR_NOERROR;
        unsigned long flags;
@@ -1536,7 +1536,7 @@ static void ced_disconnect(struct usb_interface *interface)
 /*  are left. NBNB we will need to have a mechanism to stop circular xfers */
 /*  from trying to fire off more urbs. We will wait up to 3 seconds for Urbs */
 /*  to be done. */
-void ced_draw_down(DEVICE_EXTENSION * pdx)
+void ced_draw_down(DEVICE_EXTENSION *pdx)
 {
        int time;
        dev_dbg(&pdx->interface->dev, "%s called", __func__);
index ed4c761..46d45ef 100644 (file)
@@ -103,7 +103,7 @@ typedef struct circBlk
 /*   memory set up for use either as a source or destination in DMA transfers. */
 typedef struct transarea
 {
-    void*       lpvBuff;                /*  User address of xfer area saved for completeness */
+    void       *lpvBuff;                /*  User address of xfer area saved for completeness */
     UINT        dwBaseOffset;           /*  offset to start of xfer area in first page */
     UINT        dwLength;               /*  Length of xfer area, in bytes */
     struct page **pPages;               /*  Points at array of locked down pages */
@@ -149,10 +149,10 @@ typedef struct _DEVICE_EXTENSION
 
     volatile bool bSendCharsPending;    /* Flag to indicate sendchar active */
     volatile bool bReadCharsPending;    /* Flag to indicate a read is primed */
-    charpCoherCharOut;                /* special aligned buffer for chars to 1401 */
-    struct urbpUrbCharOut;            /* urb used for chars to 1401 */
-    charpCoherCharIn;                 /* special aligned buffer for chars to host */
-    struct urbpUrbCharIn;             /* urb used for chars to host */
+    char *pCoherCharOut;                /* special aligned buffer for chars to 1401 */
+    struct urb *pUrbCharOut;            /* urb used for chars to 1401 */
+    char *pCoherCharIn;                 /* special aligned buffer for chars to host */
+    struct urb *pUrbCharIn;             /* urb used for chars to host */
 
     spinlock_t charOutLock;             /* to protect the outputBuffer and outputting */
     spinlock_t charInLock;              /* to protect the inputBuffer and char reads */
@@ -175,8 +175,8 @@ typedef struct _DEVICE_EXTENSION
     volatile unsigned int StagedOffset; /*  Offset within memory area for transfer start */
     volatile unsigned int StagedDone;   /*  Bytes transferred so far */
     volatile bool bStagedUrbPending;    /*  Flag to indicate active */
-    charpCoherStagedIO;               /*  buffer used for block transfers */
-    struct urbpStagedUrb;             /*  The URB to use */
+    char *pCoherStagedIO;               /*  buffer used for block transfers */
+    struct urb *pStagedUrb;             /*  The URB to use */
     spinlock_t stagedLock;              /*  protects ReadWriteMem() and circular buffer stuff */
 
     short s1401Type;                    /*  type of 1401 attached */
@@ -205,26 +205,26 @@ typedef struct _DEVICE_EXTENSION
 
 /*  Definitions of routimes used between compilation object files */
 /*  in usb1401.c */
-extern int Allowi(DEVICE_EXTENSIONpdx);
-extern int SendChars(DEVICE_EXTENSIONpdx);
+extern int Allowi(DEVICE_EXTENSION *pdx);
+extern int SendChars(DEVICE_EXTENSION *pdx);
 extern void ced_draw_down(DEVICE_EXTENSION *pdx);
 extern int ReadWriteMem(DEVICE_EXTENSION *pdx, bool Read, unsigned short wIdent,
                       unsigned int dwOffs, unsigned int dwLen);
 
 /*  in ced_ioc.c */
 extern int ClearArea(DEVICE_EXTENSION *pdx, int nArea);
-extern int SendString(DEVICE_EXTENSION* pdx, const char __user* pData, unsigned int n);
+extern int SendString(DEVICE_EXTENSION *pdx, const char __user *pData, unsigned int n);
 extern int SendChar(DEVICE_EXTENSION *pdx, char c);
-extern int Get1401State(DEVICE_EXTENSION* pdx, __u32* state, __u32* error);
+extern int Get1401State(DEVICE_EXTENSION *pdx, __u32 *state, __u32 *error);
 extern int ReadWrite_Cancel(DEVICE_EXTENSION *pdx);
-extern bool Is1401(DEVICE_EXTENSIONpdx);
-extern bool QuickCheck(DEVICE_EXTENSIONpdx, bool bTestBuff, bool bCanReset);
+extern bool Is1401(DEVICE_EXTENSION *pdx);
+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 __userpUser, int n);
+extern int GetString(DEVICE_EXTENSION *pdx, char __user *pUser, int n);
 extern int SetTransfer(DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD);
 extern int UnsetTransfer(DEVICE_EXTENSION *pdx, int nArea);
-extern int SetEvent(DEVICE_EXTENSION *pdx, TRANSFEREVENT __user*pTE);
+extern int SetEvent(DEVICE_EXTENSION *pdx, TRANSFEREVENT __user *pTE);
 extern int Stat1401(DEVICE_EXTENSION *pdx);
 extern int LineCount(DEVICE_EXTENSION *pdx);
 extern int GetOutBufSpace(DEVICE_EXTENSION *pdx);
@@ -236,15 +236,15 @@ extern int StartSelfTest(DEVICE_EXTENSION *pdx);
 extern int CheckSelfTest(DEVICE_EXTENSION *pdx, TGET_SELFTEST __user *pGST);
 extern int TypeOf1401(DEVICE_EXTENSION *pdx);
 extern int TransferFlags(DEVICE_EXTENSION *pdx);
-extern int DbgPeek(DEVICE_EXTENSION *pdx, TDBGBLOCK __userpDB);
+extern int DbgPeek(DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB);
 extern int DbgPoke(DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB);
 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 GetCircBlock(DEVICE_EXTENSION *pdx, TCIRCBLOCK __userpCB);
-extern int FreeCircBlock(DEVICE_EXTENSION *pdx, TCIRCBLOCK __userpCB);
+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);
 extern int TestEvent(DEVICE_EXTENSION *pdx, int nArea);
 #endif
index facba31..4812bbd 100644 (file)
@@ -210,19 +210,19 @@ 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, charpBuf, WORD wMax);
+U14API(short) U14NameOf1401(short hand, char *pBuf, WORD wMax);
 
 U14API(short) U14Stat1401(short hand);
 U14API(short) U14CharCount(short hand);
 U14API(short) U14LineCount(short hand);
 
-U14API(short) U14SendString(short hand, const charpString);
-U14API(short) U14GetString(short hand, charpBuffer, WORD wMaxLen);
+U14API(short) U14SendString(short hand, const char *pString);
+U14API(short) U14GetString(short hand, char *pBuffer, WORD wMaxLen);
 U14API(short) U14SendChar(short hand, char cChar);
-U14API(short) U14GetChar(short hand, charpcChar);
+U14API(short) U14GetChar(short hand, char *pcChar);
 
-U14API(short) U14LdCmd(short hand, const charcommand);
-U14API(DWORD) U14Ld(short hand, const char* vl, const char* str);
+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,
                                             DWORD dwLength, short eSz);
@@ -233,9 +233,9 @@ U14API(int)   U14TestTransferEvent(short hand, WORD wArea);
 U14API(int)   U14WaitTransferEvent(short hand, WORD wArea, int msTimeOut);
 U14API(short) U14GetTransfer(short hand, TGET_TX_BLOCK *pTransBlock);
 
-U14API(short) U14ToHost(short hand, charpAddrHost,DWORD dwSize,DWORD dw1401,
+U14API(short) U14ToHost(short hand, char *pAddrHost,DWORD dwSize,DWORD dw1401,
                                                             short eSz);
-U14API(short) U14To1401(short hand, const charpAddrHost,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,
@@ -245,7 +245,7 @@ U14API(int)   U14GetCircBlk(short hand, WORD wArea, DWORD *pdwOffs);
 U14API(int)   U14FreeCircBlk(short hand, WORD wArea, DWORD dwOffs, DWORD dwSize,
                                          DWORD *pdwOffs);
 
-U14API(short) U14StrToLongs(const charpszBuff, U14LONG *palNums, short sMaxLongs);
+U14API(short) U14StrToLongs(const char *pszBuff, U14LONG *palNums, short sMaxLongs);
 U14API(short) U14LongsFrom1401(short hand, U14LONG *palBuff, short sMaxLongs);
 
 U14API(void)  U14SetTimeout(short hand, int lTimeout);
@@ -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, charpBuf, WORD wMax);
+U14API(short) U14DriverName(short hand, char *pBuf, WORD 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, charpStr, WORD wMax);
+U14API(void)  U14GetErrorString(short nErr, char *pStr, WORD wMax);
 U14API(int)   U14MonitorRev(short hand);
 U14API(void)  U14CloseAll(void);
 
@@ -285,3 +285,4 @@ U14API(int)   U14InitLib(void);
 #endif
 
 #endif /* End of ifndef __USE1401_H__ */
+
index 7e9d587..bb8227a 100644 (file)
@@ -280,12 +280,12 @@ typedef PARAMBLK*   PPARAMBLK;
 typedef struct TransferDesc          /* Structure and type for SetTransArea */
 {
    WORD        wArea;            /* number of transfer area to set up       */
-   void FAR *  lpvBuff;          /* address of transfer area                */
+   void FAR *lpvBuff;          /* address of transfer area                */
    DWORD       dwLength;         /* length of area to set up                */
    short       eSize;            /* size to move (for swapping on MAC)      */
 } TRANSFERDESC;
 
-typedef TRANSFERDESC FAR *    LPTRANSFERDESC;
+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       */