mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 02/12] tlsf: Use NULL instead of 0 for returning NULL pointers
Date: Mon, 25 Jun 2012 19:38:20 +0200	[thread overview]
Message-ID: <1340645910-15668-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1340645910-15668-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/tlsf.c |   12 ++++++------
 1 file 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)
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-06-25 17:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 17:38 [PATCH] sparse fixes Sascha Hauer
2012-06-25 17:38 ` [PATCH 01/12] MMC i.MX esdhc: Fix sparse warnings Sascha Hauer
2012-06-25 17:38 ` Sascha Hauer [this message]
2012-06-25 17:38 ` [PATCH 03/12] qsort: declare strcmp_compar publically Sascha Hauer
2012-06-25 17:38 ` [PATCH 04/12] Do not use iomem space for dev_get_mem_region Sascha Hauer
2012-06-25 17:38 ` [PATCH 05/12] define __user empty Sascha Hauer
2012-06-25 17:38 ` [PATCH 06/12] ARM i.MX speed: sparse fixes Sascha Hauer
2012-06-25 17:38 ` [PATCH 07/12] USB ohci: Fix sparse warnings Sascha Hauer
2012-06-25 17:38 ` [PATCH 08/12] net smc911x: Use __iomem for register base Sascha Hauer
2012-06-25 17:38 ` [PATCH 09/12] ARM i.MX clocksource: put registers in iomem space Sascha Hauer
2012-06-25 17:38 ` [PATCH 10/12] USB gadget fsl: Put registers into " Sascha Hauer
2012-06-25 17:38 ` [PATCH 11/12] fs FAT: fix warning: Using plain integer as NULL pointer Sascha Hauer
2012-06-25 17:38 ` [PATCH 12/12] of: Fix usage of 0 " Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340645910-15668-3-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox