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

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

 



What is the point of these changes?


> -----Original Message-----
> From: rjwysocki@xxxxxxxxx [mailto:rjwysocki@xxxxxxxxx] On Behalf Of
> Rafael J. Wysocki
> Sent: Monday, November 14, 2016 12:21 PM
> To: Bart Van Assche <bart.vanassche@xxxxxxxxxxx>; Zheng, Lv
> <lv.zheng@xxxxxxxxx>; Moore, Robert <robert.moore@xxxxxxxxx>
> Cc: Rafael J. Wysocki <rjw@xxxxxxxxxxxxx>; Len Brown <lenb@xxxxxxxxxx>;
> linux-acpi@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH] acpi: Use NULL from <linux/stddef.h>
> 
> 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
��.n��������+%������w��{.n�����{�����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[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