Patchwork remove some warnings

login
register
about
Submitter Myles Watson
Date 2010-03-24 20:24:56
Message ID <2831fecf1003241324s36c4765fgd103742c91b9e27@mail.gmail.com>
Download mbox | patch
Permalink /patch/1139/
State Superseded
Headers show

Comments

Myles Watson - 2010-03-24 20:24:56
Ping.

I've inlined a representative snippet.  Not only does it get rid of the
warnings, it gets rid of a lot of casting.

Thanks,
Myles

     current = ALIGN(current, 16);

Patch

Index: svn/src/mainboard/tyan/s2895/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/tyan/s2895/acpi_tables.c
+++ svn/src/mainboard/tyan/s2895/acpi_tables.c
@@ -20,7 +20,7 @@ 
 #include <../../../northbridge/amd/amdk8/amdk8_acpi.h>
 #include <cpu/amd/model_fxx_powernow.h>

-extern unsigned char AmlCode[];
+extern acpi_header_t AmlCode;

 unsigned long acpi_fill_mcfg(unsigned long current)
 {
@@ -164,8 +164,8 @@  unsigned long write_acpi_tables(unsigned
     current = ALIGN(current, 16);
     dsdt = (acpi_header_t *) current;
     printk_debug("ACPI:    * DSDT %p\n", dsdt);
-    current += ((acpi_header_t *) AmlCode)->length;
-    memcpy((void*) dsdt, (void*)AmlCode,
((acpi_header_t*)AmlCode)->length);
+    current += AmlCode.length;
+    memcpy((void*) dsdt, &AmlCode, AmlCode.length);
     printk_debug("ACPI:    * DSDT @ %p Length %x\n",dsdt,dsdt->length);