summaryrefslogtreecommitdiffstats
path: root/common/tlsf.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-06-22 12:44:03 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-06-30 22:34:54 +0200
commitaee2920a88b4a5fe8c80184591b5f3eb0e9adcef (patch)
tree70fd837adc822f3ae464c28f1a42dbb21513423e /common/tlsf.c
parentcbba2694031a60d758e044f6b34460a3e298769e (diff)
downloadbarebox-aee2920a88b4a5fe8c80184591b5f3eb0e9adcef.tar.gz
tlsf: Use NULL instead of 0 for returning NULL pointers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/tlsf.c')
-rw-r--r--common/tlsf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/tlsf.c b/common/tlsf.c
index c810e8d..9515ac7 100644
--- a/common/tlsf.c
+++ b/common/tlsf.c
@@ -367,7 +367,7 @@ static block_header_t* search_suitable_block(pool_t* pool, int* fli, int* sli)
if (!fl_map)
{
/* No free blocks available, memory has been exhausted. */
- return 0;
+ return NULL;
}
fl = tlsf_ffs(fl_map);
@@ -563,7 +563,7 @@ static block_header_t* block_trim_free_leading(pool_t* pool, block_header_t* blo
static block_header_t* block_locate_free(pool_t* pool, size_t size)
{
int fl = 0, sl = 0;
- block_header_t* block = 0;
+ block_header_t* block = NULL;
if (size)
{
@@ -582,7 +582,7 @@ static block_header_t* block_locate_free(pool_t* pool, size_t size)
static void* block_prepare_used(pool_t* pool, block_header_t* block, size_t size)
{
- void* p = 0;
+ void* p = NULL;
if (block)
{
block_trim_free(pool, block, size);
@@ -737,7 +737,7 @@ size_t tlsf_block_size(void* ptr)
** tlsf_create, equal to the size of a pool_t plus overhead of the initial
** free block and the sentinel block.
*/
-size_t tlsf_overhead()
+size_t tlsf_overhead(void)
{
const size_t pool_overhead = sizeof(pool_t) + 2 * block_header_overhead;
return pool_overhead;
@@ -790,7 +790,7 @@ tlsf_pool tlsf_create(void* mem, size_t bytes)
(unsigned int)(pool_overhead + block_size_min),
(unsigned int)(pool_overhead + block_size_max));
#endif
- return 0;
+ return NULL;
}
/* Construct a valid pool object. */
@@ -915,7 +915,7 @@ void tlsf_free(tlsf_pool tlsf, void* ptr)
void* tlsf_realloc(tlsf_pool tlsf, void* ptr, size_t size)
{
pool_t* pool = tlsf_cast(pool_t*, tlsf);
- void* p = 0;
+ void* p = NULL;
/* Zero-size requests are treated as free. */
if (ptr && size == 0)