]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - drivers/bcm570x_queue.h
* Code cleanup:
[karo-tx-uboot.git] / drivers / bcm570x_queue.h
index bc32ad70f2db77598a687b19027701b652c272b3..336b3caa4a96657bf4719b7e314cc4028fb3d02f 100644 (file)
@@ -103,14 +103,13 @@ typedef struct {
 
 /* Declare queue type macro. */
 #define DECLARE_QUEUE_TYPE(_QUEUE_TYPE, _QUEUE_SIZE)            \
-                                                                \
+                                                               \
     typedef struct {                                            \
-        QQ_CONTAINER Container;                                 \
-        PQQ_ENTRY EntryBuffer[_QUEUE_SIZE];                     \
+       QQ_CONTAINER Container;                                 \
+       PQQ_ENTRY EntryBuffer[_QUEUE_SIZE];                     \
     } _QUEUE_TYPE, *P##_QUEUE_TYPE
 
 
-
 /******************************************************************************/
 /* Compilation switches. */
 /******************************************************************************/
@@ -144,7 +143,6 @@ unsigned int QueueSize) {
 } /* QQ_InitQueue */
 
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
@@ -161,7 +159,6 @@ PQQ_CONTAINER pQueue) {
 } /* QQ_Full */
 
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
@@ -174,7 +171,6 @@ PQQ_CONTAINER pQueue) {
 } /* QQ_Empty */
 
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
@@ -187,7 +183,6 @@ PQQ_CONTAINER pQueue) {
 } /* QQ_GetSize */
 
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
@@ -200,7 +195,6 @@ PQQ_CONTAINER pQueue) {
 } /* QQ_GetEntryCnt */
 
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
@@ -218,7 +212,7 @@ PQQ_ENTRY pEntry) {
 
 #if !defined(QQ_NO_OVERFLOW_CHECK)
     if(Head == pQueue->Tail) {
-        return 0;
+       return 0;
     } /* if */
 #endif /* QQ_NO_OVERFLOW_CHECK */
 
@@ -231,7 +225,6 @@ PQQ_ENTRY pEntry) {
 } /* QQ_PushHead */
 
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
@@ -247,13 +240,13 @@ PQQ_ENTRY pEntry) {
 
     Tail = pQueue->Tail;
     if(Tail == 0) {
-        Tail = pQueue->Size;
+       Tail = pQueue->Size;
     } /* if */
     Tail--;
 
 #if !defined(QQ_NO_OVERFLOW_CHECK)
     if(Tail == pQueue->Head) {
-        return 0;
+       return 0;
     } /* if */
 #endif /* QQ_NO_OVERFLOW_CHECK */
 
@@ -266,7 +259,6 @@ PQQ_ENTRY pEntry) {
 } /* QQ_PushTail */
 
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
@@ -282,12 +274,12 @@ PQQ_CONTAINER pQueue) {
 
 #if !defined(QQ_NO_UNDERFLOW_CHECK)
     if(Head == pQueue->Tail) {
-        return (PQQ_ENTRY) 0;
+       return (PQQ_ENTRY) 0;
     } /* if */
 #endif /* QQ_NO_UNDERFLOW_CHECK */
 
     if(Head == 0) {
-        Head = pQueue->Size;
+       Head = pQueue->Size;
     } /* if */
     Head--;
 
@@ -304,7 +296,6 @@ PQQ_CONTAINER pQueue) {
 } /* QQ_PopHead */
 
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
@@ -320,7 +311,7 @@ PQQ_CONTAINER pQueue) {
 
 #if !defined(QQ_NO_UNDERFLOW_CHECK)
     if(Tail == pQueue->Head) {
-        return (PQQ_ENTRY) 0;
+       return (PQQ_ENTRY) 0;
     } /* if */
 #endif /* QQ_NO_UNDERFLOW_CHECK */
 
@@ -337,7 +328,6 @@ PQQ_CONTAINER pQueue) {
 } /* QQ_PopTail */
 
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
@@ -350,16 +340,16 @@ QQ_GetHead(
 {
     if(Idx >= atomic_read(&pQueue->EntryCnt))
     {
-        return (PQQ_ENTRY) 0;
+       return (PQQ_ENTRY) 0;
     }
 
     if(pQueue->Head > Idx)
     {
-        Idx = pQueue->Head - Idx;
+       Idx = pQueue->Head - Idx;
     }
     else
     {
-        Idx = pQueue->Size - (Idx - pQueue->Head);
+       Idx = pQueue->Size - (Idx - pQueue->Head);
     }
     Idx--;
 
@@ -367,7 +357,6 @@ QQ_GetHead(
 }
 
 
-
 /******************************************************************************/
 /* Description:                                                               */
 /*                                                                            */
@@ -380,13 +369,13 @@ QQ_GetTail(
 {
     if(Idx >= atomic_read(&pQueue->EntryCnt))
     {
-        return (PQQ_ENTRY) 0;
+       return (PQQ_ENTRY) 0;
     }
 
     Idx += pQueue->Tail;
     if(Idx >= pQueue->Size)
     {
-        Idx = Idx - pQueue->Size;
+       Idx = Idx - pQueue->Size;
     }
 
     return pQueue->Array[Idx];
@@ -395,5 +384,4 @@ QQ_GetTail(
 #endif /* QQ_USE_MACROS */
 
 
-
 #endif /* QUEUE_H */