Misra C fixes:
[keystone-rtos/edma3_lld.git] / packages / ti / sdo / edma3 / rm / sample / src / sample_cs.c
index 802421f6f55a0ba72801d2ffc0697e88ef7dcfa3..1ef9d2b3a15ba5062192aa911879ed1cda7c5136 100755 (executable)
 \r
 #include <ti/sdo/edma3/rm/sample/bios6_edma3_rm_sample.h>\r
 \r
-extern unsigned int ccXferCompInt[][EDMA3_MAX_REGIONS];\r
-extern unsigned int ccErrorInt[];\r
-extern unsigned int tcErrorInt[][EDMA3_MAX_TC];\r
+extern uint32_t ccXferCompInt[EDMA3_MAX_EDMA3_INSTANCES][EDMA3_MAX_REGIONS];\r
+extern uint32_t ccErrorInt[EDMA3_MAX_EDMA3_INSTANCES];\r
+extern uint32_t tcErrorInt[EDMA3_MAX_EDMA3_INSTANCES][EDMA3_MAX_TC];\r
 \r
 /**\r
  * Shadow Region on which the executable is running. Its value is\r
  * populated with the DSP Instance Number here in this case.\r
  */\r
-extern unsigned int region_id;\r
+extern uint32_t region_id;\r
 \r
 /**\r
  * \brief   EDMA3 OS Protect Entry\r
@@ -75,16 +75,16 @@ extern unsigned int region_id;
  *      for EDMA3_OS_PROTECT_INTERRUPT protection level).\r
  * \return  None\r
  */\r
-void edma3OsProtectEntry (unsigned int edma3InstanceId, \r
-                                                       int level, unsigned int *intState)\r
+void edma3OsProtectEntry (uint32_t edma3InstanceId,\r
+                                                       int32_t level, uint32_t *intState)\r
     {\r
     if (((level == EDMA3_OS_PROTECT_INTERRUPT)\r
         || (level == EDMA3_OS_PROTECT_INTERRUPT_TC_ERROR))\r
         && (intState == NULL))\r
         {\r
-        return;\r
+            /* Nothing to be done here */\r
         }\r
-    else\r
+        else\r
         {\r
         switch (level)\r
             {\r
@@ -135,6 +135,7 @@ void edma3OsProtectEntry (unsigned int edma3InstanceId,
                 break;\r
             }\r
         }\r
+        return;\r
     }\r
 \r
 \r
@@ -155,8 +156,8 @@ void edma3OsProtectEntry (unsigned int edma3InstanceId,
  *      for EDMA3_OS_PROTECT_INTERRUPT protection level).\r
  * \return  None\r
  */\r
-void edma3OsProtectExit (unsigned int edma3InstanceId,\r
-                        int level, unsigned int intState)\r
+void edma3OsProtectExit (uint32_t edma3InstanceId,\r
+                        int32_t level, uint32_t intState)\r
     {\r
     switch (level)\r
         {\r
@@ -228,7 +229,7 @@ void edma3OsProtectExit (unsigned int edma3InstanceId,
  *      semaphore\r
  * \return  EDMA3_RM_SOK if succesful, else a suitable error code.\r
  */\r
-EDMA3_RM_Result edma3OsSemCreate(int initVal,\r
+EDMA3_RM_Result edma3OsSemCreate(int32_t initVal,\r
                                                        const Semaphore_Params *semParams,\r
                                EDMA3_OS_Sem_Handle *hSem)\r
     {\r
@@ -286,12 +287,11 @@ EDMA3_RM_Result edma3OsSemDelete(EDMA3_OS_Sem_Handle hSem)
  *      a free semaphore.\r
  * \param   hSem [IN] is the handle of the specified semaphore\r
  * \param   mSecTimeout [IN] is wait time in milliseconds\r
- * \return  EDMA3_RM_Result if successful else a suitable error code\r
+ * \return  EDMA3_Result if successful else a suitable error code\r
  */\r
-EDMA3_RM_Result edma3OsSemTake(EDMA3_OS_Sem_Handle hSem, int mSecTimeout)\r
+EDMA3_Result edma3OsSemTake(EDMA3_OS_Sem_Handle hSem, int32_t mSecTimeout)\r
     {\r
-    EDMA3_RM_Result semTakeResult = EDMA3_RM_SOK;\r
-    unsigned short semPendResult;\r
+    EDMA3_Result semTakeResult = EDMA3_RM_SOK;\r
 \r
     if(NULL == hSem)\r
         {\r
@@ -299,10 +299,9 @@ EDMA3_RM_Result edma3OsSemTake(EDMA3_OS_Sem_Handle hSem, int mSecTimeout)
         }\r
     else\r
         {\r
-        semPendResult = Semaphore_pend(hSem, mSecTimeout);\r
-        if (semPendResult == FALSE)\r
+        if((Semaphore_pend(hSem, (uint32_t)mSecTimeout)) == FALSE)\r
             {\r
-            semTakeResult = EDMA3_RM_E_SEMAPHORE;\r
+                semTakeResult = EDMA3_RM_E_SEMAPHORE;\r
             }\r
         }\r
 \r
@@ -316,11 +315,11 @@ EDMA3_RM_Result edma3OsSemTake(EDMA3_OS_Sem_Handle hSem, int mSecTimeout)
  *      This function gives or relinquishes an already\r
  *      acquired semaphore token\r
  * \param   hSem [IN] is the handle of the specified semaphore\r
- * \return  EDMA3_RM_Result if successful else a suitable error code\r
+ * \return  EDMA3_Result if successful else a suitable error code\r
  */\r
-EDMA3_RM_Result edma3OsSemGive(EDMA3_OS_Sem_Handle hSem)\r
+EDMA3_Result edma3OsSemGive(EDMA3_OS_Sem_Handle hSem)\r
     {\r
-    EDMA3_RM_Result semGiveResult = EDMA3_RM_SOK;\r
+    EDMA3_Result semGiveResult = EDMA3_RM_SOK;\r
 \r
     if(NULL == hSem)\r
         {\r