Code Review
/
o-du
/
l2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
U8, U16, U32 data type changes
[o-du/l2.git]
/
src
/
cm
/
cm_mblk.c
diff --git
a/src/cm/cm_mblk.c
b/src/cm/cm_mblk.c
index
7831b91
..
fb6b913
100644
(file)
--- a/
src/cm/cm_mblk.c
+++ b/
src/cm/cm_mblk.c
@@
-47,7
+47,7
@@
EXTERN pthread_t tmpRegTidMap[20];
#define CM_MEM_GET_REGION(_region) \
{ \
EXTERN pthread_t tmpRegTidMap[20];
#define CM_MEM_GET_REGION(_region) \
{ \
-
U8
_regCnt; \
+
uint8_t
_regCnt; \
_region = 0xFF; \
\
for(_regCnt = 0; _regCnt < 12; _regCnt++) \
_region = 0xFF; \
\
for(_regCnt = 0; _regCnt < 12; _regCnt++) \
@@
-105,7
+105,6
@@
Ptr *ptr; /* Location to place allocated event ptr */
CmMemListCp *memCp; /* memory Link list control point */
CmMemCb *cb; /* Allocated Memory Control Block */
CmMemListCp *memCp; /* memory Link list control point */
CmMemCb *cb; /* Allocated Memory Control Block */
- TRC2(cmAllocEvnt)
/* Validation check */
#ifndef LTE_ENB_PAL
/* Validation check */
#ifndef LTE_ENB_PAL
@@
-137,8
+136,8
@@
Ptr *ptr; /* Location to place allocated event ptr */
return RFAILED;
/* Reset the contents */
return RFAILED;
/* Reset the contents */
-
cmMemset((U8 *)allocPtr, (U8 )
0,
- (
PTR)(
maxBlkSize + sizeof(CmMemList)) );
+
memset(allocPtr,
0,
+ (maxBlkSize + sizeof(CmMemList)) );
/* The above allocated memory chunk is structured as follows
/* The above allocated memory chunk is structured as follows
@@
-215,12
+214,11
@@
Mem *sMem; /* Static Memory region and pool */
#endif
{
#endif
{
- TRC2(cmInitMemCp)
/* Intialise Memory Control Point */
CM_INIT_MEMCP(memCp,maxBlkSize,sMem);
/* Intialise Memory Control Point */
CM_INIT_MEMCP(memCp,maxBlkSize,sMem);
-
RETVOID
;
+
return
;
} /* End of cmInitMemCp */
} /* End of cmInitMemCp */
@@
-261,7
+259,6
@@
Ptr *allocPtr; /* location to place pointer */
/* cm_mblk_c_001.101: added local variable */
Size blkSize; /* required block size */
/* cm_mblk_c_001.101: added local variable */
Size blkSize; /* required block size */
- TRC2(cmGetMem)
memCp = (CmMemListCp *)memPtr;
cb = &memCp->memCb;
memCp = (CmMemListCp *)memPtr;
cb = &memCp->memCb;
@@
-283,7
+280,7
@@
Ptr *allocPtr; /* location to place pointer */
{
/* if a chunk is already there */
if( (cb->memAllocated + size) <=
{
/* if a chunk is already there */
if( (cb->memAllocated + size) <=
- (
U32
)(cb->maxSize + sizeof(CmMemList)) )
+ (
uint32_t
)(cb->maxSize + sizeof(CmMemList)) )
{
/* Requested memory is available in present chunk */
*allocPtr = (Ptr) cb->runPtr;
{
/* Requested memory is available in present chunk */
*allocPtr = (Ptr) cb->runPtr;
@@
-310,8
+307,8
@@
Ptr *allocPtr; /* location to place pointer */
/* Reset the contents */
/* Initialise above allocated structure */
/* cm_mblk_c_001.101: use blkSize instead of cb->maxSize */
/* Reset the contents */
/* Initialise above allocated structure */
/* cm_mblk_c_001.101: use blkSize instead of cb->maxSize */
-
cmMemset((U8 *)cb->initPtr, (U8 )
0,
- (
PTR)(
blkSize + sizeof(CmMemList) ));
+
memset(&(cb->initPtr),
0,
+ (blkSize + sizeof(CmMemList) ));
/* The above allocated memory chunk is structured as follows
/* The above allocated memory chunk is structured as follows
@@
-381,7
+378,6
@@
Ptr *ptr; /* Location to place allocated event ptr */
CmMemListCp *memCp; /* memory Link list control point */
CmMemCb *cb; /* Allocated Memory Control Block */
CmMemListCp *memCp; /* memory Link list control point */
CmMemCb *cb; /* Allocated Memory Control Block */
- TRC2(cmAllocEvntNoInit)
/* Validation check */
if( evntSize > maxBlkSize)
/* Validation check */
if( evntSize > maxBlkSize)
@@
-401,8
+397,8
@@
Ptr *ptr; /* Location to place allocated event ptr */
return RFAILED;
/* Reset the contents */
return RFAILED;
/* Reset the contents */
-
cmMemset((U8 *)allocPtr, (U8 )
0,
- (
PTR)(
sizeof(CmMemList)) );
+
memset(allocPtr,
0,
+ (sizeof(CmMemList)) );
/* The above allocated memory chunk is structured as follows
/* The above allocated memory chunk is structured as follows
@@
-484,7
+480,6
@@
Ptr *allocPtr; /* location to place pointer */
/* cm_mblk_c_001.101: added local variable */
Size blkSize; /* required block size */
/* cm_mblk_c_001.101: added local variable */
Size blkSize; /* required block size */
- TRC2(cmGetMemNoInit)
memCp = (CmMemListCp *)memPtr;
cb = &memCp->memCb;
memCp = (CmMemListCp *)memPtr;
cb = &memCp->memCb;
@@
-506,11
+501,11
@@
Ptr *allocPtr; /* location to place pointer */
{
/* if a chunk is already there */
if( (cb->memAllocated + size) <=
{
/* if a chunk is already there */
if( (cb->memAllocated + size) <=
- (
U32
)(cb->maxSize + sizeof(CmMemList)) )
+ (
uint32_t
)(cb->maxSize + sizeof(CmMemList)) )
{
/* Requested memory is available in present chunk */
*allocPtr = (Ptr) cb->runPtr;
{
/* Requested memory is available in present chunk */
*allocPtr = (Ptr) cb->runPtr;
- //
cmMemset((U8 *)*allocPtr, (U8
)0,
+ //
memset(*allocPtr, (uint8_t
)0,
// (PTR)(size) );
cb->memAllocated += size;
cb->runPtr += size;
// (PTR)(size) );
cb->memAllocated += size;
cb->runPtr += size;
@@
-535,8
+530,8
@@
Ptr *allocPtr; /* location to place pointer */
/* Reset the contents */
/* Initialise above allocated structure */
/* cm_mblk_c_001.101: use blkSize instead of cb->maxSize */
/* Reset the contents */
/* Initialise above allocated structure */
/* cm_mblk_c_001.101: use blkSize instead of cb->maxSize */
-
cmMemset((U8 *)cb->initPtr, (U8 )
0,
- (
PTR)(
sizeof(CmMemList)));
+
memset(&(cb->initPtr),
0,
+ (sizeof(CmMemList)));
/* The above allocated memory chunk is structured as follows
+-------------------+
/* The above allocated memory chunk is structured as follows
+-------------------+
@@
-600,7
+595,6
@@
Ptr memPtr; /* Link List CP */
CmMemList *prevNode; /* Pointer to previous node */
CmMemListCp *lcp; /* Memory Link List */
CmMemList *prevNode; /* Pointer to previous node */
CmMemListCp *lcp; /* Memory Link List */
- TRC2(cmFreeMem)
lcp = (CmMemListCp *)memPtr;
lcp = (CmMemListCp *)memPtr;
@@
-638,7
+632,7
@@
Ptr memPtr; /* Link List CP */
count--;
}
count--;
}
-
RETVOID
;
+
return
;
} /* End of cmFreeMem */
} /* End of cmFreeMem */
@@
-668,7
+662,6
@@
CmMemListCp *lCp; /* list control point */
CmMemList *node; /* node to be added */
#endif
{
CmMemList *node; /* node to be added */
#endif
{
- TRC3(cmAddMemNode);
lCp->count++;
lCp->count++;
@@
-679,11
+672,11
@@
CmMemList *node; /* node to be added */
if (!node->prev)
{
lCp->first = node;
if (!node->prev)
{
lCp->first = node;
-
RETVOID
;
+
return
;
}
node->prev->next = node;
}
node->prev->next = node;
-
RETVOID
;
+
return
;
} /* end of cmAddMemNode */
} /* end of cmAddMemNode */
@@
-719,7
+712,6
@@
CmMemStatus *status; /* memory region,pool and status */
CmMemListCp *memCp; /* Memory Link List */
CmMemListCp *memCp; /* Memory Link List */
- TRC3(cmGetMemStatus)
memCp = (CmMemListCp *)memPtr;
memCp = (CmMemListCp *)memPtr;
@@
-730,7
+722,7
@@
CmMemStatus *status; /* memory region,pool and status */
status->maxBlkSize = memCp->memCb.maxSize;
status->memAllocated = memCp->memCb.memAllocated;
status->maxBlkSize = memCp->memCb.maxSize;
status->memAllocated = memCp->memCb.memAllocated;
-
RETVOID
;
+
return
;
} /* End of cmGetMemStatus */
} /* End of cmGetMemStatus */