[PATCH] NULL: remove other definition of NULL

Antony Pavlov antonynpavlov at gmail.com
Wed Apr 13 08:37:18 PDT 2016


On Wed, 13 Apr 2016 20:11:33 +0800
Du Huanpeng <d-hp at 163.com> wrote:

> From: Du Huanpeng <u74147 at gmail.com>
> 
> remove other definition of NULL, use
>   #include <linux/stddef.h>
> instead.
> I use this command to search NULL definition,
>   grep -R "define\s*\<NULL\>"
> hope there are no more definition of NULL.
> 
> Signed-off-by: Du Huanpeng <u74147 at gmail.com>
> ---
>  include/command.h   |  5 +----
>  lib/bzlib_private.h | 11 +----------
>  2 files changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/include/command.h b/include/command.h
> index e41068a..b938431 100644
> --- a/include/command.h
> +++ b/include/command.h
> @@ -25,10 +25,7 @@
>  
>  #include <linux/list.h>
>  #include <linux/stringify.h>
> -
> -#ifndef NULL
> -#define NULL	((void *)0)
> -#endif
> +#include <linux/stddef.h>

It looks like this chunk removes lines introduced in your previous 'NULL: define as a null pointer'
patch.

Can we join your patches?

>  #ifndef	__ASSEMBLY__
>  
> diff --git a/lib/bzlib_private.h b/lib/bzlib_private.h
> index 87d8f94..de10dd4 100644
> --- a/lib/bzlib_private.h
> +++ b/lib/bzlib_private.h
> @@ -67,6 +67,7 @@
>  #define _BZLIB_PRIVATE_H
>  
>  #include <malloc.h>
> +#include <linux/stddef.h>
>  
>  #include "bzlib.h"
>  
> @@ -515,16 +516,6 @@ BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*,
>  
>  #endif
>  
> -
> -/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/
> -
> -#ifdef BZ_NO_STDIO
> -#ifndef NULL
> -#define NULL 0
> -#endif
> -#endif
> -
> -
>  /*-------------------------------------------------------------*/
>  /*--- end                                   bzlib_private.h ---*/
>  /*-------------------------------------------------------------*/
> -- 
> 1.9.1
> 
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
-- 
Best regards,
  Antony Pavlov



More information about the barebox mailing list