lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 26 Sep 2014 01:48:06 +0200
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	Fabian Frederick <fabf@...net.be>
Cc:	linux-kernel@...r.kernel.org, Len Brown <lenb@...nel.org>,
	linux-acpi@...r.kernel.org
Subject: Re: [PATCH 1/1 linux-next] ACPI: processor: use container_of to resolve acpi_madt_local_apic/sapic/x2apic from acpi_subtable_header

On Sunday, September 14, 2014 03:12:43 PM Fabian Frederick wrote:
> Use container_of instead of casting first structure member.
> 
> Signed-off-by: Fabian Frederick <fabf@...net.be>

Queued up for 3.18, thanks!

> ---
> 
> Compiled but untested.
> 
>  drivers/acpi/processor_core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
> index e32321c..ef58f46 100644
> --- a/drivers/acpi/processor_core.c
> +++ b/drivers/acpi/processor_core.c
> @@ -16,7 +16,7 @@ static int map_lapic_id(struct acpi_subtable_header *entry,
>  		 u32 acpi_id, int *apic_id)
>  {
>  	struct acpi_madt_local_apic *lapic =
> -		(struct acpi_madt_local_apic *)entry;
> +		container_of(entry, struct acpi_madt_local_apic, header);
>  
>  	if (!(lapic->lapic_flags & ACPI_MADT_ENABLED))
>  		return -ENODEV;
> @@ -32,7 +32,7 @@ static int map_x2apic_id(struct acpi_subtable_header *entry,
>  			 int device_declaration, u32 acpi_id, int *apic_id)
>  {
>  	struct acpi_madt_local_x2apic *apic =
> -		(struct acpi_madt_local_x2apic *)entry;
> +		container_of(entry, struct acpi_madt_local_x2apic, header);
>  
>  	if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
>  		return -ENODEV;
> @@ -49,7 +49,7 @@ static int map_lsapic_id(struct acpi_subtable_header *entry,
>  		int device_declaration, u32 acpi_id, int *apic_id)
>  {
>  	struct acpi_madt_local_sapic *lsapic =
> -		(struct acpi_madt_local_sapic *)entry;
> +		container_of(entry, struct acpi_madt_local_sapic, header);
>  
>  	if (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))
>  		return -ENODEV;
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ