linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] acpi: Use NULL from <linux/stddef.h>
@ 2016-11-14 16:50 Bart Van Assche
  2016-11-14 20:20 ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Van Assche @ 2016-11-14 16:50 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown; +Cc: linux-acpi@vger.kernel.org

Use the definition of NULL from <linux/stddef.h> instead of
redefining NULL. Additionally, change (void *)NULL into NULL.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org
---
 include/acpi/actypes.h | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 1d798ab..f019641 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -44,6 +44,8 @@
 #ifndef __ACTYPES_H__
 #define __ACTYPES_H__
 
+#include <linux/stddef.h> /* NULL */
+
 /* acpisrc:struct_defs -- for acpisrc conversion */
 
 /*
@@ -437,10 +439,6 @@ typedef u64 acpi_physical_address;
 #endif
 #define TRUE                            (1 == 1)
 
-#ifndef NULL
-#define NULL                            (void *) 0
-#endif
-
 /*
  * Miscellaneous types
  */
@@ -530,9 +528,9 @@ typedef u64 acpi_integer;
 
 /* Pointer/Integer type conversions */
 
-#define ACPI_TO_POINTER(i)              ACPI_ADD_PTR (void, (void *) NULL,(acpi_size) i)
-#define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) NULL)
-#define ACPI_OFFSET(d, f)               ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) NULL)
+#define ACPI_TO_POINTER(i)              ACPI_ADD_PTR(void, NULL, (acpi_size) i)
+#define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF(p, NULL)
+#define ACPI_OFFSET(d, f)               ACPI_PTR_DIFF(&(((d *) 0)->f), NULL)
 #define ACPI_PHYSADDR_TO_PTR(i)         ACPI_TO_POINTER(i)
 #define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
 
-- 
2.10.1


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

end of thread, other threads:[~2016-11-18  2:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-14 16:50 [PATCH] acpi: Use NULL from <linux/stddef.h> Bart Van Assche
2016-11-14 20:20 ` Rafael J. Wysocki
2016-11-16 17:08   ` Moore, Robert
2016-11-16 17:15     ` Bart Van Assche
2016-11-17  5:54       ` Zheng, Lv
2016-11-18  2:27         ` Moore, Robert
2016-11-18  2:05       ` Moore, Robert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).