Misra C fix: in edma3_drv_adv.c
authorSunil MS <x0190988@ti.com>
Wed, 13 Aug 2014 08:47:09 +0000 (14:17 +0530)
committerSunil MS <x0190988@ti.com>
Thu, 9 Oct 2014 14:09:19 +0000 (19:39 +0530)
Redundant paranthesis
built in datatypes

Change-Id: If9cf4fa24bea00ba04a000f2bc4398d2f387a473
Signed-off-by: Sunil MS <x0190988@ti.com>
packages/ti/sdo/edma3/drv/edma3_drv.h
packages/ti/sdo/edma3/drv/src/edma3_drv_adv.c
packages/ti/sdo/edma3/rm/edma3_common.h

index 459da1d1c27a7f7049b2ccdedc854c136d0e0dc0..3d322e6940a54b8ee6611dd9a521f71068998176 100755 (executable)
@@ -1998,42 +1998,42 @@ typedef enum
     /**
      * The OPT field (Offset Address 0x0 Bytes)
      */
-    EDMA3_DRV_PARAM_ENTRY_OPT                       = 0,
+    EDMA3_DRV_PARAM_ENTRY_OPT                       = 0U,
 
     /**
      * The SRC field (Offset Address 0x4 Bytes)
      */
-    EDMA3_DRV_PARAM_ENTRY_SRC                       = 1,
+    EDMA3_DRV_PARAM_ENTRY_SRC                       = 1U,
 
     /**
      * The (ACNT+BCNT) field (Offset Address 0x8 Bytes)
      */
-    EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT                 = 2,
+    EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT                 = 2U,
 
     /**
      * The DST field (Offset Address 0xC Bytes)
      */
-    EDMA3_DRV_PARAM_ENTRY_DST                       = 3,
+    EDMA3_DRV_PARAM_ENTRY_DST                       = 3U,
 
     /**
      * The (SRCBIDX+DSTBIDX) field (Offset Address 0x10 Bytes)
      */
-    EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX              = 4,
+    EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX              = 4U,
 
     /**
      * The (LINK+BCNTRLD) field (Offset Address 0x14 Bytes)
      */
-    EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD              = 5,
+    EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD              = 5U,
 
     /**
      * The (SRCCIDX+DSTCIDX) field (Offset Address 0x18 Bytes)
      */
-    EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX              = 6,
+    EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX              = 6U,
 
     /**
      * The (CCNT+RSVD) field (Offset Address 0x1C Bytes)
      */
-    EDMA3_DRV_PARAM_ENTRY_CCNT                      = 7
+    EDMA3_DRV_PARAM_ENTRY_CCNT                      = 7U
 
 } EDMA3_DRV_PaRAMEntry;
 
index 5abb7ac4e35dc86c784d06474f2c87126a07dfd6..b4b593249f46de827670beebceaaff73ef6c6971 100755 (executable)
@@ -197,7 +197,7 @@ EDMA3_DRV_Result EDMA3_DRV_linkChannel (EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -230,14 +230,14 @@ EDMA3_DRV_Result EDMA3_DRV_linkChannel (EDMA3_DRV_Handle hEdma,
         {
         /* Get the Link-bcntReload PaRAM set entry */
         linkBcntReld = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAM1Id].OPT) +
-                            (uint32_t)EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
-        linkBcntReld &= 0xFFFF0000u;
+                            EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
+        linkBcntReld &= 0xFFFF0000U;
         /* Update the Link field with lch2 PaRAM set */
         linkBcntReld |= (0xFFFFu & (uint32_t)(&(globalRegs->PARAMENTRY [paRAM2Id].OPT)));
 
         /* Store it back */
         *((&globalRegs->PARAMENTRY[paRAM1Id].OPT)
-                    + (uint32_t)EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD) = linkBcntReld;
+                    + EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD) = linkBcntReld;
 
         /*
         * Set the TCC field of PaRAM set associated with lch2 to
@@ -309,7 +309,7 @@ EDMA3_DRV_Result EDMA3_DRV_unlinkChannel (EDMA3_DRV_Handle hEdma, uint32_t lCh)
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -332,14 +332,14 @@ EDMA3_DRV_Result EDMA3_DRV_unlinkChannel (EDMA3_DRV_Handle hEdma, uint32_t lCh)
                {
                /* Get the Link-bcntReload PaRAM set entry */
                linkBcntReld = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT)
-                                                       + (uint32_t)EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
+                                                       + EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
 
                /* Remove any linking */
                linkBcntReld |= 0xFFFFu;
 
                /* Store it back */
                *((&globalRegs->PARAMENTRY[paRAMId].OPT)
-                           + (uint32_t)EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD) = linkBcntReld;
+                           + EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD) = linkBcntReld;
                }
                }
 
@@ -400,7 +400,7 @@ EDMA3_DRV_Result EDMA3_DRV_chainChannel (EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -526,7 +526,7 @@ EDMA3_DRV_Result EDMA3_DRV_unchainChannel (EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -611,7 +611,7 @@ EDMA3_DRV_Result EDMA3_DRV_setQdmaTrigWord (EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -682,7 +682,7 @@ EDMA3_DRV_Result EDMA3_DRV_setPaRAM (EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -759,7 +759,7 @@ EDMA3_DRV_Result EDMA3_DRV_getPaRAM (EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -840,7 +840,7 @@ EDMA3_DRV_Result EDMA3_DRV_setPaRAMEntry (EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -924,7 +924,7 @@ EDMA3_DRV_Result EDMA3_DRV_getPaRAMEntry (EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -1004,7 +1004,7 @@ EDMA3_DRV_Result EDMA3_DRV_setPaRAMField (EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -1043,84 +1043,84 @@ EDMA3_DRV_Result EDMA3_DRV_setPaRAMField (EDMA3_DRV_Handle hEdma,
         switch (paRAMField)
             {
             case EDMA3_DRV_PARAM_FIELD_OPT:
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_OPT) = newPaRAMFieldVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_OPT) = newPaRAMFieldVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_SRCADDR:
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC) = newPaRAMFieldVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC) = newPaRAMFieldVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_ACNT:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT));
-                paramEntryVal &= 0xFFFF0000u;
-                newPaRAMFieldVal &= 0x0000FFFFu;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT));
+                paramEntryVal &= 0xFFFF0000U;
+                newPaRAMFieldVal &= 0x0000FFFFU;
                 paramEntryVal |= newPaRAMFieldVal;
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT) = paramEntryVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT) = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_BCNT:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT));
-                paramEntryVal &= 0x0000FFFFu;
-                newPaRAMFieldVal <<= 0x10u;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT));
+                paramEntryVal &= 0x0000FFFFU;
+                newPaRAMFieldVal <<= 0x10U;
                 paramEntryVal |= newPaRAMFieldVal;
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT) = paramEntryVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT) = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_DESTADDR:
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_DST) = newPaRAMFieldVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_DST) = newPaRAMFieldVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_SRCBIDX:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX));
-                paramEntryVal &= 0xFFFF0000u;
-                newPaRAMFieldVal &= 0x0000FFFFu;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX));
+                paramEntryVal &= 0xFFFF0000U;
+                newPaRAMFieldVal &= 0x0000FFFFU;
                 paramEntryVal |= newPaRAMFieldVal;
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX) = paramEntryVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX) = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_DESTBIDX:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX));
-                paramEntryVal &= 0x0000FFFFu;
-                newPaRAMFieldVal <<= 0x10u;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX));
+                paramEntryVal &= 0x0000FFFFU;
+                newPaRAMFieldVal <<= 0x10U;
                 paramEntryVal |= newPaRAMFieldVal;
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX) = paramEntryVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX) = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_LINKADDR:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
-                paramEntryVal &= 0xFFFF0000u;
-                newPaRAMFieldVal &= 0x0000FFFFu;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
+                paramEntryVal &= 0xFFFF0000U;
+                newPaRAMFieldVal &= 0x0000FFFFU;
                 paramEntryVal |= newPaRAMFieldVal;
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD) = paramEntryVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD) = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_BCNTRELOAD:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
-                paramEntryVal &= 0x0000FFFFu;
-                newPaRAMFieldVal <<= 0x10u;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
+                paramEntryVal &= 0x0000FFFFU;
+                newPaRAMFieldVal <<= 0x10U;
                 paramEntryVal |= newPaRAMFieldVal;
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD) = paramEntryVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD) = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_SRCCIDX:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX));
-                paramEntryVal &= 0xFFFF0000u;
-                newPaRAMFieldVal &= 0x0000FFFFu;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX));
+                paramEntryVal &= 0xFFFF0000U;
+                newPaRAMFieldVal &= 0x0000FFFFU;
                 paramEntryVal |= newPaRAMFieldVal;
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX) = paramEntryVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX) = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_DESTCIDX:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX));
-                paramEntryVal &= 0x0000FFFFu;
-                newPaRAMFieldVal <<= 0x10u;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX));
+                paramEntryVal &= 0x0000FFFFU;
+                newPaRAMFieldVal <<= 0x10U;
                 paramEntryVal |= newPaRAMFieldVal;
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX) = paramEntryVal;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX) = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_CCNT:
-                newPaRAMFieldVal &= 0x0000FFFFu;
-                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_CCNT) = newPaRAMFieldVal;
+                newPaRAMFieldVal &= 0x0000FFFFU;
+                *((&globalRegs->PARAMENTRY[paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_CCNT) = newPaRAMFieldVal;
                 break;
 
             default:
@@ -1186,7 +1186,7 @@ EDMA3_DRV_Result EDMA3_DRV_getPaRAMField (EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -1212,67 +1212,67 @@ EDMA3_DRV_Result EDMA3_DRV_getPaRAMField (EDMA3_DRV_Handle hEdma,
         switch (paRAMField)
             {
             case EDMA3_DRV_PARAM_FIELD_OPT:
-                *currPaRAMFieldVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_OPT));
+                *currPaRAMFieldVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_OPT));
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_SRCADDR:
-                *currPaRAMFieldVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC));
+                *currPaRAMFieldVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC));
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_ACNT:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT));
-                paramEntryVal &= 0x0000FFFFu;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT));
+                paramEntryVal &= 0x0000FFFFU;
                 *currPaRAMFieldVal = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_BCNT:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT));
-                paramEntryVal = paramEntryVal >> 0x10u;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_ACNT_BCNT));
+                paramEntryVal = paramEntryVal >> 0x10U;
                 *currPaRAMFieldVal = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_DESTADDR:
-                *currPaRAMFieldVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_DST));
+                *currPaRAMFieldVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_DST));
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_SRCBIDX:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX));
-                paramEntryVal &= 0x0000FFFFu;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX));
+                paramEntryVal &= 0x0000FFFFU;
                 *currPaRAMFieldVal = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_DESTBIDX:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX));
-                paramEntryVal = paramEntryVal >> 0x10u;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_BIDX));
+                paramEntryVal = paramEntryVal >> 0x10U;
                 *currPaRAMFieldVal = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_LINKADDR:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
-                paramEntryVal &= 0x0000FFFFu;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
+                paramEntryVal &= 0x0000FFFFU;
                 *currPaRAMFieldVal = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_BCNTRELOAD:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
-                paramEntryVal = paramEntryVal >> 0x10u;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_LINK_BCNTRLD));
+                paramEntryVal = paramEntryVal >> 0x10U;
                 *currPaRAMFieldVal = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_SRCCIDX:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX));
-                paramEntryVal &= 0x0000FFFFu;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX));
+                paramEntryVal &= 0x0000FFFFU;
                 *currPaRAMFieldVal = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_DESTCIDX:
-                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX));
-                paramEntryVal = paramEntryVal >> 0x10u;
+                paramEntryVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_SRC_DST_CIDX));
+                paramEntryVal = paramEntryVal >> 0x10U;
                 *currPaRAMFieldVal = paramEntryVal;
                 break;
 
             case EDMA3_DRV_PARAM_FIELD_CCNT:
-                *currPaRAMFieldVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + (unsigned)EDMA3_DRV_PARAM_ENTRY_CCNT));
+                *currPaRAMFieldVal = (uint32_t)(*((&globalRegs->PARAMENTRY [paRAMId].OPT) + EDMA3_DRV_PARAM_ENTRY_CCNT));
                 break;
 
             default:
@@ -1329,7 +1329,7 @@ EDMA3_DRV_Result EDMA3_DRV_setEvtQPriority (EDMA3_DRV_Handle hEdma,
             }
         else
             {
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
 
                        /* If parameter checking is enabled... */
 #ifndef EDMA3_DRV_PARAM_CHECK_DISABLE
@@ -1418,7 +1418,7 @@ EDMA3_DRV_Result EDMA3_DRV_mapChToEvtQ(EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -1532,7 +1532,7 @@ EDMA3_DRV_Result EDMA3_DRV_getMapChToEvtQ (EDMA3_DRV_Handle hEdma,
 
        if (EDMA3_DRV_SOK == result)
                {
-        globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+        globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                edma3Id = drvObject->phyCtrllerInstId;
 
         if (channelId <= edma3_dma_ch_max_val [edma3Id])
@@ -1624,7 +1624,7 @@ EDMA3_DRV_Result EDMA3_DRV_setCCRegister (EDMA3_DRV_Handle hEdma,
                                                                        EDMA3_OS_PROTECT_INTERRUPT,
                                                                        &intState);
                     /* Global interrupts disabled, modify the registers. */
-                    regPhyAddr = (uint32_t)(drvObject->gblCfgParams.globalRegs) + regOffset;
+                    regPhyAddr = (uint32_t)drvObject->gblCfgParams.globalRegs + regOffset;
 
                     *(uint32_t *)regPhyAddr = newRegValue;
 
@@ -1689,7 +1689,7 @@ EDMA3_DRV_Result EDMA3_DRV_getCCRegister ( EDMA3_DRV_Handle hEdma,
             {
             if (drvObject->gblCfgParams.globalRegs != NULL)
                 {
-                regPhyAddr = (uint32_t)(drvObject->gblCfgParams.globalRegs) + regOffset;
+                regPhyAddr = (uint32_t)drvObject->gblCfgParams.globalRegs + regOffset;
 
                 *regValue = *(uint32_t *)regPhyAddr;
                 }
@@ -1756,15 +1756,15 @@ EDMA3_DRV_Result EDMA3_DRV_waitAndClearTcc (EDMA3_DRV_Handle hEdma,
                        /* Check if the parameters are OK. */
                        if (EDMA3_DRV_SOK == result)
                 {
-                globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+                globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                 shadowRegs = (volatile EDMA3_CCRL_ShadowRegs *)
-                                        (&globalRegs->SHADOW[drvInst->regionId]);
+                                        &globalRegs->SHADOW[drvInst->regionId];
 
                 if (shadowRegs != NULL)
                     {
                     if(tccNo < 32u)
                         {
-                        tccBitMask = (1u << tccNo);
+                        tccBitMask = 1u << tccNo;
 
                         /* Check the status of the IPR[tccNo] bit. */
                         while (FALSE == (shadowRegs->IPR & tccBitMask))
@@ -1780,7 +1780,7 @@ EDMA3_DRV_Result EDMA3_DRV_waitAndClearTcc (EDMA3_DRV_Handle hEdma,
                         }
                     else
                         {
-                        tccBitMask = (1u << (tccNo - 32u));
+                        tccBitMask = 1u << (tccNo - 32u);
 
                         /* Check the status of the IPRH[tccNo-32] bit. */
                         while (FALSE == (shadowRegs->IPRH & tccBitMask))
@@ -1861,9 +1861,9 @@ EDMA3_DRV_Result EDMA3_DRV_checkAndClearTcc (EDMA3_DRV_Handle hEdma,
                        /* Check if the parameters are OK. */
                        if (EDMA3_DRV_SOK == result)
                 {
-                globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+                globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                 shadowRegs = (volatile EDMA3_CCRL_ShadowRegs *)
-                                        (&globalRegs->SHADOW[drvInst->regionId]);
+                                        &globalRegs->SHADOW[drvInst->regionId];
 
                 /* Reset the tccStatus */
                 *tccStatus = FALSE;
@@ -1872,7 +1872,7 @@ EDMA3_DRV_Result EDMA3_DRV_checkAndClearTcc (EDMA3_DRV_Handle hEdma,
                     {
                     if(tccNo < 32u)
                         {
-                        tccBitMask = (1u << tccNo);
+                        tccBitMask = 1u << tccNo;
 
                         /* Check the status of the IPR[tccNo] bit. */
                         if ((shadowRegs->IPR & tccBitMask) != FALSE)
@@ -1886,7 +1886,7 @@ EDMA3_DRV_Result EDMA3_DRV_checkAndClearTcc (EDMA3_DRV_Handle hEdma,
                         }
                     else
                         {
-                        tccBitMask = (1u << (tccNo - 32u));
+                        tccBitMask = 1u << (tccNo - 32u);
 
                         /* Check the status of the IPRH[tccNo-32] bit. */
                         if ((shadowRegs->IPRH & tccBitMask) != FALSE)
@@ -1955,7 +1955,7 @@ EDMA3_DRV_Result EDMA3_DRV_getPaRAMPhyAddr(EDMA3_DRV_Handle hEdma,
         else
             {
             edma3Id = drvObject->phyCtrllerInstId;
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
                }
                }
 
@@ -2002,7 +2002,7 @@ EDMA3_DRV_Result EDMA3_DRV_Ioctl(
     EDMA3_DRV_Instance *drvInst = NULL;
 
     /* To remove CCS warnings */
-    (void)param;
+    (void *)param;
 
 #ifdef EDMA3_INSTRUMENTATION_ENABLED
     EDMA3_LOG_EVENT(&DVTEvent_Log,"EDMA3",
@@ -2070,6 +2070,7 @@ EDMA3_DRV_Result EDMA3_DRV_Ioctl(
             default:
                 /* You passed invalid IOCTL cmd */
                 result = EDMA3_DRV_E_INVALID_PARAM;
+                               break;
             }
         }
 
@@ -2355,7 +2356,7 @@ EDMA3_DRV_Result EDMA3_DRV_setTcErrorInt(uint32_t phyCtrllerInstId,
 
        if (EDMA3_DRV_SOK == result)
         {
-        tcRegs = (volatile EDMA3_TCRL_Regs *)(drvObject->gblCfgParams.tcRegs[tcId]);
+        tcRegs = (volatile EDMA3_TCRL_Regs *)drvObject->gblCfgParams.tcRegs[tcId];
 
            if (NULL == tcRegs)
                {
@@ -2372,7 +2373,7 @@ EDMA3_DRV_Result EDMA3_DRV_setTcErrorInt(uint32_t phyCtrllerInstId,
                                break;
 
                case EDMA3_DRV_TC_ERR_BUSERR_EN:
-                               tcRegs->ERREN |= (1 << EDMA3_TCRL_ERREN_BUSERR_SHIFT);
+                               tcRegs->ERREN = tcRegs->ERREN | (1 << EDMA3_TCRL_ERREN_BUSERR_SHIFT);
                                break;
 
                case EDMA3_DRV_TC_ERR_TRERR_DIS:
@@ -2380,7 +2381,7 @@ EDMA3_DRV_Result EDMA3_DRV_setTcErrorInt(uint32_t phyCtrllerInstId,
                                break;
 
                case EDMA3_DRV_TC_ERR_TRERR_EN:
-                               tcRegs->ERREN |= (1 << EDMA3_TCRL_ERREN_TRERR_SHIFT);
+                               tcRegs->ERREN = tcRegs->ERREN | (1 << EDMA3_TCRL_ERREN_TRERR_SHIFT);
                                break;
 
                case EDMA3_DRV_TC_ERR_MMRAERR_DIS:
@@ -2388,7 +2389,7 @@ EDMA3_DRV_Result EDMA3_DRV_setTcErrorInt(uint32_t phyCtrllerInstId,
                                break;
 
                case EDMA3_DRV_TC_ERR_MMRAERR_EN:
-                               tcRegs->ERREN |= (1 << EDMA3_TCRL_ERREN_MMRAERR_SHIFT);
+                               tcRegs->ERREN = tcRegs->ERREN | (1 << EDMA3_TCRL_ERREN_MMRAERR_SHIFT);
                                break;
 
                case EDMA3_DRV_TC_ERR_DIS:
@@ -2396,9 +2397,9 @@ EDMA3_DRV_Result EDMA3_DRV_setTcErrorInt(uint32_t phyCtrllerInstId,
                                break;
 
                case EDMA3_DRV_TC_ERR_EN:
-                               tcRegs->ERREN = (EDMA3_TCRL_ERREN_BUSERR_MASK
+                               tcRegs->ERREN = EDMA3_TCRL_ERREN_BUSERR_MASK
                                                                | EDMA3_TCRL_ERREN_TRERR_MASK
-                                                               | EDMA3_TCRL_ERREN_MMRAERR_MASK);
+                                                               | EDMA3_TCRL_ERREN_MMRAERR_MASK;
                                break;
 
                        default:
@@ -2460,9 +2461,9 @@ EDMA3_DRV_Result EDMA3_DRV_getChannelStatus(EDMA3_DRV_Handle hEdma,
             }
         else
             {
-            globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+            globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
             shadowRegs = (volatile EDMA3_CCRL_ShadowRegs *)
-                                    (&globalRegs->SHADOW[drvInst->regionId]);
+                                    &globalRegs->SHADOW[drvInst->regionId];
             edma3Id = drvObject->phyCtrllerInstId;
                }
                }
@@ -2475,8 +2476,8 @@ EDMA3_DRV_Result EDMA3_DRV_getChannelStatus(EDMA3_DRV_Handle hEdma,
         }
 
        /* Not valid for Link channels */
-    if ( lCh >= edma3_link_ch_min_val [edma3Id]
-               && lCh <= edma3_link_ch_max_val [edma3Id])
+    if ( (lCh >= edma3_link_ch_min_val [edma3Id])
+               && (lCh <= edma3_link_ch_max_val [edma3Id]))
         {
         result = EDMA3_DRV_E_INVALID_PARAM;
         }
@@ -2524,8 +2525,8 @@ EDMA3_DRV_Result EDMA3_DRV_getChannelStatus(EDMA3_DRV_Handle hEdma,
                        }
 
        /* QDMA Channel, check for event miss */
-               if (lCh >= edma3_qdma_ch_min_val[edma3Id]
-                       && lCh <= edma3_qdma_ch_max_val[edma3Id])
+               if ((lCh >= edma3_qdma_ch_min_val[edma3Id])
+                       && (lCh <= edma3_qdma_ch_max_val[edma3Id]))
                        {
                        uint32_t qdma_ch = lCh - edma3_qdma_ch_min_val[edma3Id];
 
@@ -2599,11 +2600,11 @@ EDMA3_DRV_Result EDMA3_DRV_mapTccLinkCh ( EDMA3_DRV_Handle hEdma,
        if (EDMA3_DRV_SOK == result)
         {
         edma3Id = drvObject->phyCtrllerInstId;
-        globalRegs = (volatile EDMA3_CCRL_Regs *)(drvObject->gblCfgParams.globalRegs);
+        globalRegs = (volatile EDMA3_CCRL_Regs *)drvObject->gblCfgParams.globalRegs;
 
         /* Validate the arguments */
-               if ((linkCh < edma3_link_ch_min_val[edma3Id] ||
-                               linkCh > edma3_link_ch_max_val[edma3Id]) ||
+               if (((linkCh < edma3_link_ch_min_val[edma3Id]) ||
+                               (linkCh > edma3_link_ch_max_val[edma3Id])) ||
                                (tcc >= drvObject->gblCfgParams.numTccs))
                        {
                        result = EDMA3_DRV_E_INVALID_PARAM;
@@ -2614,7 +2615,7 @@ EDMA3_DRV_Result EDMA3_DRV_mapTccLinkCh ( EDMA3_DRV_Handle hEdma,
         {
         paRAMId = edma3DrvChBoundRes[edma3Id][linkCh].paRAMId;
 
-        if (paRAMId < 0 || paRAMId >= drvObject->gblCfgParams.numPaRAMSets)
+        if ((paRAMId < 0) || (paRAMId >= drvObject->gblCfgParams.numPaRAMSets))
             {
             result = EDMA3_DRV_E_INVALID_PARAM;
             }
index 5f3ce67c42476bcdffccdfadb96825d42d5d1b61..48badc1363be02868a929be3dea11a4e8543e688 100755 (executable)
 #ifndef _EDMA3_COMMON_H_
 #define _EDMA3_COMMON_H_
 
+/***************************************************************\
+* Standard Definition Header File For Null Definition *
+\***************************************************************/
+#include <stddef.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -82,9 +87,9 @@ typedef int32_t             EDMA3_RM_Result;
 typedef int32_t             EDMA3_DRV_Result;
 
 /** EDMA3 Resource Manager Result OK */
-#define EDMA3_RM_SOK             (0U)
+#define EDMA3_RM_SOK             (0)
 /** EDMA3 Driver Result OK */
-#define EDMA3_DRV_SOK            (0U)
+#define EDMA3_DRV_SOK            (0)
 
 /**
  * EDMA3 Resource Manager Handle.