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

Re: [Xen-devel] [PATCH v4 08/21] arm/acpi: Parse MADT to map logical cpu to MPIDR and get cpu_possible_map



>>> On 23.01.16 at 10:20, <zhaoshenglong@xxxxxxxxxx> wrote:
> --- a/xen/include/xen/acpi.h
> +++ b/xen/include/xen/acpi.h
> @@ -39,6 +39,10 @@
>  #define ACPI_MADT_GET_POLARITY(inti) ACPI_MADT_GET_(POLARITY, inti)
>  #define ACPI_MADT_GET_TRIGGER(inti)  ACPI_MADT_GET_(TRIGGER, inti)
>  
> +#define BAD_MADT_ENTRY(entry, end) (                                        \
> +                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
> +                ((struct acpi_subtable_header *)entry)->length < 
> sizeof(*entry))

If you move or otherwise anyway touch existing code, please
always take a critical look at it and at least fix obvious problems.
Read, here: Properly parenthesize all uses of the macro's
parameters. While not desirable, failing to do so may be
acceptable when the scope of such definitions is very limited (as
it was before you moving it), but once globally exposed it needs
to be made safe.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.