]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/netapi.git/commitdiff
Removed RM OSAL functions, now part of hplib, coverity cleanup
authorTinku Mannan <tmannan@ti.com>
Fri, 21 Nov 2014 19:45:39 +0000 (14:45 -0500)
committerTinku Mannan <tmannan@ti.com>
Mon, 24 Nov 2014 13:48:44 +0000 (08:48 -0500)
ti/runtime/netapi/src/netapi.c [changed mode: 0644->0755]
ti/runtime/netapi/test/net_test_loopback.c
ti/runtime/netapi/test/nt_bridge.c
ti/runtime/netapi/utils/netapi_util_rm.c

old mode 100644 (file)
new mode 100755 (executable)
index 4108bb6..db9301e
@@ -144,12 +144,14 @@ NETAPI_T netapi_init(int                master,
 
         if (pBase == NULL)
         {
+            free(p);
             return NULL;
         }
 
         if (hplib_shmAddEntry(pBase, sizeof(NETAPI_SHM_T), NETAPI_ENTRY) !=
             hplib_OK)
         {
+            free(p);
             return NULL;
         }
         hplib_utilOsalCreate();
@@ -158,7 +160,7 @@ NETAPI_T netapi_init(int                master,
       created SHM area for us already, so just open it */
     else
     {
-        pBase = hplib_shmOpen(HPLIB_SHM_SIZE);
+        pBase = hplib_shmOpen();
         if (pBase)
             Osal_start(pBase);
     }
index d88fc9f354f7804ed7baacd327eadc19605e3d3f..7049f46ef8cb9d83bc23f775700803370b512852 100755 (executable)
@@ -373,8 +373,6 @@ int coreid=0;
                 meta_tx.enetPort = 0;
                  memcpy(&p_pkt[netTest_MAC_HEADER_LEN+netTest_IP_HEADER_LEN],&p_sa_info_tx->spi,4);
             }
-            else
-                return;
 
             meta_tx.pseudoHdrChecksum =
             netTest_utilGetIPv4PsudoChkSum(&p_pkt[meta_tx.ipOffBytes],8+ meta_tx.ploadLen);
index 503a174e6302c105428098374574644b6fc6b6c8..a28f3f27936790e023758319f733db39cf720635 100755 (executable)
@@ -385,7 +385,7 @@ void ntBrideProcessCfgFile(FILE * fpr, ntBridgeCfgFile_T *pConfig)
 
         for(i=0;i< MAX_PBIT_ENTRIES;i++)
         {
-            sprintf(temp_str,"pbit_map_%d",i);
+            snprintf(temp_str,TEMP_STR_LEN-1,"pbit_map_%d",i);
             CHECK_SET_PARAM2(temp_str,&pConfig->pbitMapF[i][0],&pConfig->pbitMapQ[i][0]);
         }
     }
index 2a3edc0af0a10be4917884245fa8fe2eb5a12927..0794956bcdf410a3ed8a843602e057c3d4cc5248 100755 (executable)
 
 #include "ti/runtime/netapi/netapi.h"
 
-
-uint32_t    Osal_rm_MallocCounter = 0;
-uint32_t    Osal_rm_FreeCounter   = 0;
-
-
 /* Socket Includes */
 #include "sockutils.h"
 #include "sockrmmsg.h"
@@ -106,83 +101,6 @@ Transport_MapEntry  rmTransportMap[MAX_MAPPING_ENTRIES];
 
 hplib_spinLock_T net_test_rm_lock;
 
-
-
-void *Osal_rmMalloc (uint32_t num_bytes)
-{
-    /* Increment the allocation counter. */
-    Osal_rm_MallocCounter++;
-
-    /* Allocate memory. */
-    return calloc(1, num_bytes);
-}
-void Osal_rmFree (void *ptr, uint32_t size)
-{
-    /* Increment the free counter. */
-    Osal_rm_FreeCounter++;
-    free(ptr);
-}
-
-void *Osal_rmCsEnter(void)
-{
-    return NULL;
-}
-
-void Osal_rmCsExit(void *CsHandle)
-{
-
-}
-void Osal_rmBeginMemAccess(void *ptr, uint32_t size)
-{
-    return;
-}
-void Osal_rmEndMemAccess(void *ptr, uint32_t size)
-{
-    return;
-}
-
-void *Osal_rmTaskBlockCreate(void)
-{
-    return(NULL);
-}
-
-void Osal_rmTaskBlock(void *handle)
-{
-
-}
-
-void Osal_rmTaskUnblock(void *handle)
-{
-
-}
-
-void Osal_rmTaskBlockDelete(void *handle)
-{
-
-}
-
-void Osal_rmLog (char *fmt, ... )
-{
-    va_list ap;
-    
-    va_start(ap, fmt);
-    vprintf(fmt, ap);
-    va_end(ap);
-}
-
-void *Osal_rmMtCsEnter(void *mtSemObj)
-{
-    return NULL;
-}
-
-
-void Osal_rmMtCsExit(void *mtSemObj, void *CsHandle)
-{
-
-}
 Rm_Packet *transportAlloc(Rm_AppTransportHandle appTransport, uint32_t pktSize, Rm_PacketHandle *pktHandle)
 {
     Rm_Packet *rm_pkt = NULL;
@@ -328,7 +246,6 @@ int initRm (void)
     int32_t            result;
 
 
-    //net_test_rm_lock = hplib_spinLock_UNLOCKED_INITIALIZER;
     hplib_mSpinLockInit(&net_test_rm_lock );
     
     /* Initialize the RM Client - RM must be initialized before anything else in the system */