Staging: hv: cleanup coding style issues in RingBuffer.h
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 18 Aug 2009 00:22:08 +0000 (17:22 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Sep 2009 19:01:55 +0000 (12:01 -0700)
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/RingBuffer.c
drivers/staging/hv/RingBuffer.h

index 571f9db4160e836af842de05e6c238c226c6270f..0ea6a0f4a22da01441a88090ee6aa9110b1b41f9 100644 (file)
@@ -203,8 +203,7 @@ Description:
        Dump out to console the ring buffer info
 
 --*/
-static void
-DumpRingInfo(RING_BUFFER_INFO* RingInfo, char *Prefix)
+void DumpRingInfo(RING_BUFFER_INFO *RingInfo, char *Prefix)
 {
        u32 bytesAvailToWrite;
        u32 bytesAvailToRead;
@@ -249,11 +248,8 @@ Description:
        Get various debug metrics for the specified ring buffer
 
 --*/
-static void
-RingBufferGetDebugInfo(
-       RING_BUFFER_INFO                *RingInfo,
-       RING_BUFFER_DEBUG_INFO  *DebugInfo
-       )
+void RingBufferGetDebugInfo(RING_BUFFER_INFO *RingInfo,
+                           RING_BUFFER_DEBUG_INFO *DebugInfo)
 {
        u32 bytesAvailToWrite;
        u32 bytesAvailToRead;
@@ -281,10 +277,7 @@ Description:
        Get the interrupt mask for the specified ring buffer
 
 --*/
-static u32
-GetRingBufferInterruptMask(
-       RING_BUFFER_INFO *rbi
-       )
+u32 GetRingBufferInterruptMask(RING_BUFFER_INFO *rbi)
 {
        return rbi->RingBuffer->InterruptMask;
 }
@@ -298,12 +291,7 @@ Description:
        Initialize the ring buffer
 
 --*/
-static int
-RingBufferInit(
-       RING_BUFFER_INFO        *RingInfo,
-       void                            *Buffer,
-       u32                             BufferLen
-       )
+int RingBufferInit(RING_BUFFER_INFO *RingInfo, void *Buffer, u32 BufferLen)
 {
        ASSERT(sizeof(RING_BUFFER) == PAGE_SIZE);
 
@@ -329,10 +317,7 @@ Description:
        Cleanup the ring buffer
 
 --*/
-static void
-RingBufferCleanup(
-       RING_BUFFER_INFO* RingInfo
-       )
+void RingBufferCleanup(RING_BUFFER_INFO* RingInfo)
 {
 }
 
@@ -345,12 +330,8 @@ Description:
        Write to the ring buffer
 
 --*/
-static int
-RingBufferWrite(
-       RING_BUFFER_INFO *OutRingInfo,
-       struct scatterlist *sglist,
-       u32 sgcount
-       )
+int RingBufferWrite(RING_BUFFER_INFO *OutRingInfo,
+                   struct scatterlist *sglist, u32 sgcount)
 {
        int i=0;
        u32 byteAvailToWrite;
@@ -436,12 +417,7 @@ Description:
        Read without advancing the read index
 
 --*/
-static int
-RingBufferPeek(
-       RING_BUFFER_INFO*       InRingInfo,
-       void*                           Buffer,
-       u32                             BufferLen
-       )
+int RingBufferPeek(RING_BUFFER_INFO *InRingInfo, void *Buffer, u32 BufferLen)
 {
        u32 bytesAvailToWrite;
        u32 bytesAvailToRead;
@@ -485,13 +461,8 @@ Description:
        Read and advance the read index
 
 --*/
-static int
-RingBufferRead(
-       RING_BUFFER_INFO*       InRingInfo,
-       void *                          Buffer,
-       u32                             BufferLen,
-       u32                             Offset
-       )
+int RingBufferRead(RING_BUFFER_INFO *InRingInfo, void *Buffer,
+                  u32 BufferLen, u32 Offset)
 {
        u32 bytesAvailToWrite;
        u32 bytesAvailToRead;
index 16586148bef98b822445d3b212009f43132e7887..17e859fa510410bb0bef9180256b5c0f2866c954 100644 (file)
 #include "include/osd.h"
 
 typedef struct _RING_BUFFER {
-    volatile u32       WriteIndex;     /* Offset in bytes from the start of ring data below */
-    volatile u32       ReadIndex;      /* Offset in bytes from the start of ring data below */
+       /* Offset in bytes from the start of ring data below */
+       volatile u32 WriteIndex;
+
+       /* Offset in bytes from the start of ring data below */
+       volatile u32 ReadIndex;
 
        volatile u32 InterruptMask;
-       u8      Reserved[4084];                 /* Pad it to PAGE_SIZE so that data starts on page boundary */
-       /* NOTE: The InterruptMask field is used only for channels but since our vmbus connection */
-       /* also uses this data structure and its data starts here, we commented out this field. */
+
+       /* Pad it to PAGE_SIZE so that data starts on page boundary */
+       u8      Reserved[4084];
+
+       /* NOTE:
+        * The InterruptMask field is used only for channels but since our
+        * vmbus connection also uses this data structure and its data starts
+        * here, we commented out this field.
+        */
        /* volatile u32 InterruptMask; */
-       /* Ring data starts here + RingDataStartOffset !!! DO NOT place any fields below this !!! */
-    u8         Buffer[0];
+
+       /*
+        * Ring data starts here + RingDataStartOffset
+        * !!! DO NOT place any fields below this !!!
+        */
+       u8 Buffer[0];
 } __attribute__((packed)) RING_BUFFER;
 
 typedef struct _RING_BUFFER_INFO {
-    RING_BUFFER*       RingBuffer;
-    u32                        RingSize;                       /* Include the shared header */
+       RING_BUFFER *RingBuffer;
+       u32 RingSize;                   /* Include the shared header */
        spinlock_t ring_lock;
 
-    u32                        RingDataSize;           /* < ringSize */
-       u32                     RingDataStartOffset;
+       u32 RingDataSize;               /* < ringSize */
+       u32 RingDataStartOffset;
 
 } RING_BUFFER_INFO;
 
-
 typedef struct _RING_BUFFER_DEBUG_INFO {
-       u32             CurrentInterruptMask;
-       u32             CurrentReadIndex;
-       u32             CurrentWriteIndex;
-       u32             BytesAvailToRead;
-       u32             BytesAvailToWrite;
-}RING_BUFFER_DEBUG_INFO;
+       u32 CurrentInterruptMask;
+       u32 CurrentReadIndex;
+       u32 CurrentWriteIndex;
+       u32 BytesAvailToRead;
+       u32 BytesAvailToWrite;
+} RING_BUFFER_DEBUG_INFO;
 
 
 
 /* Interface */
 
 
-static int
-RingBufferInit(
-       RING_BUFFER_INFO        *RingInfo,
-       void *                          Buffer,
-       u32                             BufferLen
-       );
-
-static void
-RingBufferCleanup(
-       RING_BUFFER_INFO        *RingInfo
-       );
-
-static int
-RingBufferWrite(
-       RING_BUFFER_INFO *RingInfo,
-       struct scatterlist *sglist,
-       u32 sgcount
-       );
-
-static int
-RingBufferPeek(
-       RING_BUFFER_INFO        *RingInfo,
-       void *                          Buffer,
-       u32                             BufferLen
-       );
-
-static int
-RingBufferRead(
-       RING_BUFFER_INFO        *RingInfo,
-       void *                          Buffer,
-       u32                             BufferLen,
-       u32                             Offset
-       );
-
-static u32
-GetRingBufferInterruptMask(
-       RING_BUFFER_INFO *RingInfo
-       );
-
-static void
-DumpRingInfo(
-       RING_BUFFER_INFO* RingInfo,
-       char *Prefix
-       );
-
-static void
-RingBufferGetDebugInfo(
-       RING_BUFFER_INFO                *RingInfo,
-       RING_BUFFER_DEBUG_INFO  *DebugInfo
-       );
+int RingBufferInit(RING_BUFFER_INFO *RingInfo, void *Buffer, u32 BufferLen);
+
+void RingBufferCleanup(RING_BUFFER_INFO *RingInfo);
+
+int RingBufferWrite(RING_BUFFER_INFO *RingInfo,
+                   struct scatterlist *sglist,
+                   u32 sgcount);
+
+int RingBufferPeek(RING_BUFFER_INFO *RingInfo, void *Buffer, u32 BufferLen);
+
+int RingBufferRead(RING_BUFFER_INFO *RingInfo,
+                  void *Buffer,
+                  u32 BufferLen,
+                  u32 Offset);
+
+u32 GetRingBufferInterruptMask(RING_BUFFER_INFO *RingInfo);
+
+void DumpRingInfo(RING_BUFFER_INFO *RingInfo, char *Prefix);
+
+void RingBufferGetDebugInfo(RING_BUFFER_INFO *RingInfo,
+                           RING_BUFFER_DEBUG_INFO *DebugInfo);
 
 #endif /* _RING_BUFFER_H_ */