mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] NULL: keep NULL definition in stddef.h only
@ 2016-04-13 16:04 DU HUANPENG
  2016-04-14  6:02 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: DU HUANPENG @ 2016-04-13 16:04 UTC (permalink / raw)
  To: t-kernel, barebox; +Cc: norep1y, Du Huanpeng

From: Du Huanpeng <u74147@gmail.com>

remove other local 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.

from ISO/IEC 9899:TC3:
The macros are
	NULL
which expands to an implementation-defined null pointer constant;

Signed-off-by: Du Huanpeng <u74147@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 3aca1a9..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	0
-#endif
+#include <linux/stddef.h>
 
 #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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] NULL: keep NULL definition in stddef.h only
  2016-04-13 16:04 [PATCH] NULL: keep NULL definition in stddef.h only DU HUANPENG
@ 2016-04-14  6:02 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-04-14  6:02 UTC (permalink / raw)
  To: DU HUANPENG, g; +Cc: Du Huanpeng, barebox, norep1y, t-kernel

On Wed, Apr 13, 2016 at 04:04:01PM +0000, DU HUANPENG wrote:
> From: Du Huanpeng <u74147@gmail.com>
> 
> remove other local 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.
> 
> from ISO/IEC 9899:TC3:
> The macros are
> 	NULL
> which expands to an implementation-defined null pointer constant;
> 
> Signed-off-by: Du Huanpeng <u74147@gmail.com>
> ---
>  include/command.h   |  5 +----
>  lib/bzlib_private.h | 11 +----------
>  2 files changed, 2 insertions(+), 14 deletions(-)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-14  6:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-13 16:04 [PATCH] NULL: keep NULL definition in stddef.h only DU HUANPENG
2016-04-14  6:02 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox