Re: [PATCH] acpi: Use NULL from <linux/stddef.h>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 14, 2016 at 5:50 PM, Bart Van Assche
<bart.vanassche@xxxxxxxxxxx> wrote:
> 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@xxxxxxxxxxx>
> Cc: Rafael J. Wysocki <rjw@xxxxxxxxxxxxx>
> Cc: Len Brown <lenb@xxxxxxxxxx>
> Cc: linux-acpi@xxxxxxxxxxxxxxx
> ---
>  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 */

This is file is based on upstream ACPICA code and it should not
contain Linux-specific includes etc. as a rule.

> +
>  /* 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)


Lv, Bob, can you have a look at this, please?

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux